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


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

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!

Also Read


404 Page not found

While accessing the website I was getting the error as ‘404 Page not found’ with below server…

Powered by WHMCompleteSolution

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat