Knowledgebase

How to force the site to use https using .htaccess file? Print

  • 0

If you've working SSL certificate on your website and you'd like force your website to load using 'https' in web-browser then feel free to add the below code in '.htaccess' file under root directory-

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

Let me know your thoughts on it!

Was this answer helpful?
Back