Setting Force HTTPS with .htaccess

If you had used SSL for your website, but still accessed from HTTP, so you have to force the browser to redirect to HTTPS.

This is the script to force your browser to go to HTTPS with htaccess.

#redirect http to https

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

You may also like...