Switch to https

Posted by Mike on Pro Webmasters See other posts from Pro Webmasters or by Mike
Published on 2011-06-28T03:15:00Z Indexed on 2011/06/28 8:31 UTC
Read the original article Hit count: 267

Filed under:
|
|

I'm looking to use an .htaccess file to use mod_rewrite to switch the protocol from http:// to https:// when someone hits my website.

For instance, once someone goes to: http://www.mywebsite.com/

I'd like the browser to switch to: http*s*://www.mywebsite.com/

The same goes for the http://mywebsite.com/ -> https://mywebsite.com

This is the following code I've been using and I've experienced some odd things so if anyone could provide me with information if this is the right way to do it, or if you have a better way, please provide it. Thanks in advance.

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://www.ebaillv.com/$1 [R=301,L]

© Pro Webmasters or respective owner

Related posts about apache

Related posts about htaccess