1. Home
  2. Website
  3. SSL Certificates
  4. How to force SSL with .htaccess

How to force SSL with .htaccess

To force the HTTPS connection on your website, add the following lines inside the website’s .htaccess file:

* Typical file location is public_html/.htaccess

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

Leave a Comment