Disable SSL for every page except login.php and register.php.

Options +FollowSymLinks RewriteEngine On # Turn SSL off for everything except login.php (register.php) RewriteCond %{HTTPS} on RewriteCond %{SCRIPT_FILENAME} !\/login\.php [NC] RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L] 

The above code is used to disable SSL (https: //) for every page except login.php. How can I add the register.php page, so I will have https: // enabled on the login.php and register.php pages? I tried to duplicate this line

 RewriteCond %{SCRIPT_FILENAME} !\/login\.php [NC] **RewriteCond %{SCRIPT_FILENAME} !\/register\.php [NC]** 

But that doesn't work, any ideas?

+3
source share
1 answer

You can use both inputs and register in the same state.

 RewriteCond %{SCRIPT_FILENAME} !\/(login|register)\.php [NC] 
+4
source

Source: https://habr.com/ru/post/1369173/


All Articles