Switch to https
- by Mike
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]