Important Notice:
Two sections of this forum are available only to registered customers. In order to receive access to the Customer Forums and ResellerCentral Forums, you must first register on these forums or login to your existing forum account. If you are an existing HostNine customer, be sure to register using the email address on file for your billing profile.
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Anyone know the best method to redirect certain files (eg: contact form) requested via http to https?
-Thanks in advance. |
|
#2
|
|||
|
|||
|
This may help
http://www.cyberciti.biz/tips/howto-...nnections.html http://www.howtoforge.com/forums/showthread.php?t=5117 Last edited by beholder; 01-21-2008 at 10:46 PM. |
|
#3
|
|||
|
|||
|
i did this on one of my sites using htaccess - this example applies itself to the entire site, so anything that is requested using HTTP is redirected to itself using HTTPS
Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
|
|
#4
|
|||
|
|||
|
Thanks but the above methods seem to be for the entire site and/or sub domain. I just want to redirect individual files.
|
|
#5
|
|||
|
|||
|
do a few google searches for htacess and redirects - you'll find the syntax you need to only redirect the specific files you need to.
cpanel may also have an option you can use to create redirects (I hand-edit myself so I can't confirm that). Brian |
|
#6
|
||||
|
||||
|
This delivers thatpage.shtml in place of either thispage.htm or thispage2.htm Try adding in a https: as the destination
Code:
RewriteEngine On RewriteRule ^thispage.htm$ thatpage.shtml [N] RewriteRule ^thispage2.htm$ thatpage.shtml [L] |
|
#7
|
|||
|
|||
|
the example i posted can easily be modified to only redirect specific files or folders
|
|
#8
|
|||
|
|||
|
Here is the code I finally used. It redirects example.com to www.example.com and then a specific file from http to https:
Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^example.com [nc] rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] rewritecond %{SERVER_PORT} !^443$ rewriterule ^filename\.php(.*)$ https://www.example.com/filename.php$1 [r=301] Hope this can help someone else out. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Redirect main domain to folder without changing URL | capcaunu | Shared Web Hosting | 3 | 03-25-2009 07:26 AM |
| node67 redirect | H9Alex | Maintenance/Outages | 2 | 03-19-2009 10:28 AM |
| Auto redirect on checkout problem | bandituk | WHMCS | 3 | 09-15-2008 02:03 PM |
| REDIRECT not WORKING? | mossimo | Reseller Hosting | 0 | 03-10-2008 04:42 AM |




Linear Mode

