How to Force HTTPS Using the .htaccess 1 0

Last updated on Dec 12, 2022 18:46 in Advanced
Posted ByAdmin Hostkiv

Redirect All Web Traffic

To force all web traffic to use HTTPS insert the following lines of code in the .htaccess file in your website's root folder.

NOTE: If you have existing code in your .htacess, add this above where there are already rules with a similar starting prefix.

 RewriteEngine On
 RewriteCond %{HTTPS} !=on
 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
** The time is base on America/New_York timezone