How to force SSL with .htaccess?

By 10th March 2021 April 3rd, 2021 How to, Tutourial & Tips

To force your website domain to use an HTTPS connection, add the following lines inside the website’s .htaccess file:

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