How to force SSL (https) with .htaccess? Print

  • 0

To force a browser to use an HTTPS connection on your website, add the following lines inside the website’s .htaccess file found in the public_html folder.

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



Was this answer helpful?

« Back