How to Force HTTPS Using the .htaccess

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]

Hasznosnak találta ezt a választ?

0 A felhasználók hasznosnak találták ezt