Force SSL
with simple rule in .htaccess

Even having SSL your visitors enter http instead of https?



Some CMS’s allow you to easily activate and use the system with SSL option. For example in WordPress you just have to enter https:// in both fields available under dashboard: settings / general.

Yet sometime you are not using such friendly CMS or maybe even you are a purist using html files based website. What you should do then?

Easy. Just create a file named .htaccess in the root of your website directory containing couple lines you will find below. That’s it.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Michael Skweres


Webmaster, Designer, System administrator

Post tags: htaccess, Internet, rewrite, rule, ssl

Want to SHARE?


Leave me your e-mail by clicking the button.

Leave your e-mail

If you have any questions. Leave me your e-mail and I will contact you back as soon as possible.