Apache htaccess force site to SSL

posted in: Tips and howto 0

To force an HTTPS connection on your website you just need to add this code to your .htaccess file :

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This htaccess file need to be at the root of your site

Leave a Reply