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.

Was this helpful?

1 / 0

Leave a Reply 0

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.