Community Forums

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.

Go Back   HostNine Community Forums > H9 General Forums > Lounge / Off Topic > Web Hosting

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2008, 08:50 PM
mginop mginop is offline
Newbie
 
Join Date: Feb 2007
Posts: 7
Default How do You Redirect HTTP to HTTPS ?

Anyone know the best method to redirect certain files (eg: contact form) requested via http to https?

-Thanks in advance.
Reply With Quote
  #2  
Old 01-21-2008, 09:43 PM
beholder beholder is offline
Junior Guru Wannabe
 
Join Date: Nov 2006
Posts: 90
Smile

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 09:46 PM.
Reply With Quote
  #3  
Old 01-21-2008, 09:45 PM
kingaman kingaman is offline
Junior Guru
 
Join Date: Aug 2007
Location: Melbourne, Australia
Posts: 237
Default

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}
Reply With Quote
  #4  
Old 01-22-2008, 07:19 AM
mginop mginop is offline
Newbie
 
Join Date: Feb 2007
Posts: 7
Default

Thanks but the above methods seem to be for the entire site and/or sub domain. I just want to redirect individual files.
Reply With Quote
  #5  
Old 01-22-2008, 07:58 AM
McCarthySites McCarthySites is offline
Web Hosting Guru
 
Join Date: Jun 2007
Posts: 291
Default

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
Reply With Quote
  #6  
Old 01-22-2008, 12:24 PM
Gene's Avatar
Gene Gene is offline
Aspiring Evangelist
 
Join Date: May 2007
Location: Rhode Island
Posts: 351
Default

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]
Reply With Quote
  #7  
Old 01-22-2008, 05:20 PM
kingaman kingaman is offline
Junior Guru
 
Join Date: Aug 2007
Location: Melbourne, Australia
Posts: 237
Default

the example i posted can easily be modified to only redirect specific files or folders
Reply With Quote
  #8  
Old 01-27-2008, 12:48 PM
mginop mginop is offline
Newbie
 
Join Date: Feb 2007
Posts: 7
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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 06:26 AM
node67 redirect H9Alex Maintenance/Outages 2 03-19-2009 09:28 AM
Auto redirect on checkout problem bandituk WHMCS 3 09-15-2008 01:03 PM
REDIRECT not WORKING? mossimo Reseller Hosting 0 03-10-2008 03:42 AM


All times are GMT -5. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

Host Nine

Our mission began in 2006. Thousands of awesome clients later, we are now one of the most popular hosters in the world.
Most of this is because of our fantastic support. Join us, you'll be glad you did - that's a given.