12
Oct
2007
HTTP to HTTPS via mod_rewrite
To redirect a website from http -> https I utilized mod_rewrite. And created a .htaccess file with the following contents.
$ cat .htaccess
Options FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*) https://your_server.com/$1
This can be useful if you need to ensure all access to your site, is done via HTTPS.

Thank you, this was PERFECT… I tried another popular rewrite, but it wouldn’t work.. this one worked for me.
Thanks! Glad we could help.