Force/Redirect SSL Connections in Apache

Add the following to the :80 Virtualhost config:

RewriteEngine on
RewriteCond %{HTTPS} !=on 
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

This will redirect all HTTP connections to https. Note: This will not solve issues with mixed content if the site has hard-coded HTTP:// links.

Leave a Reply

Your email address will not be published. Required fields are marked *