Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 关闭除login.php和register.php之外的每个页面的SSL_.htaccess_Mod Rewrite_Ssl - Fatal编程技术网

.htaccess 关闭除login.php和register.php之外的每个页面的SSL

.htaccess 关闭除login.php和register.php之外的每个页面的SSL,.htaccess,mod-rewrite,ssl,.htaccess,Mod Rewrite,Ssl,上面的代码用于关闭除login.php之外的每个页面的SSL(https://)。如何添加register.php页面,以便在login.php和register.php页面上启用https://协议?我试着复制这行 Options +FollowSymLinks RewriteEngine On # Turn SSL off for everything except login.php (register.php) RewriteCond %{HTTPS} on RewriteCond

上面的代码用于关闭除login.php之外的每个页面的SSL(https://)。如何添加register.php页面,以便在login.php和register.php页面上启用https://协议?我试着复制这行

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]

但是这不起作用,有什么想法吗?

您可以在相同的条件下使用登录和注册

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