How to Force HTTPS Using .htaccess

Create a .htaccess file on the root of the website and put the following code inside to Force HTTPS.

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