How to Force HTTPS using .htaccess

Even after setting up your magento to use HTTPS on the admin, the initial non-secure HTTP request to the frontend might need to be redirected to HTTPS.

You can force HTTPS on all incoming traffic by adding to your .htaccess the following lines of code:

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

And you are done 🙂

Leave a Reply

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