how-to_‎ > ‎SSL_‎ > ‎

Redirect all http to https in Apache

posted Jul 24, 2014, 4:02 AM by Daniele Albrizio   [ updated May 22, 2017, 6:08 AM ]
Inside virtualhost section for your port 80 webserver, put these lines:

        RewriteEngine on
        RewriteCond %{SERVER_PORT} 80
        RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]

a2enmod rewrite
service apache2 restart

all done.
Comments