Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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
Mod rewrite 在所有页面上强制使用https,但在查询字符串参数中具有特定值的页面除外_Mod Rewrite_Redirect_Https - Fatal编程技术网

Mod rewrite 在所有页面上强制使用https,但在查询字符串参数中具有特定值的页面除外

Mod rewrite 在所有页面上强制使用https,但在查询字符串参数中具有特定值的页面除外,mod-rewrite,redirect,https,Mod Rewrite,Redirect,Https,我已经搜索过这个网站,但我的解决方法不起作用 基本上,我需要打开所有页面的https,只有一个页面的url如下: domain.com/begin/index.php?pageid=130&usertype=1&building=2 RewriteEngine On #HTTPS OFF on pageid 130 RewriteCond %{HTTPS} on RewriteCond %{QUERY_STRING} (^|&)pageid=(130)($|&

我已经搜索过这个网站,但我的解决方法不起作用

基本上,我需要打开所有页面的https,只有一个页面的url如下:

domain.com/begin/index.php?pageid=130&usertype=1&building=2
RewriteEngine On

#HTTPS OFF on pageid 130
RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} (^|&)pageid=(130)($|&)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

#FORCE HTTPS ON ALL PAGES except for pageid 130
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} !(^|&)pageid=(130)($|&)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
如果页面具有查询字符串参数pageid=130,我不希望打开https

我的.htaccess文件如下所示:

domain.com/begin/index.php?pageid=130&usertype=1&building=2
RewriteEngine On

#HTTPS OFF on pageid 130
RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} (^|&)pageid=(130)($|&)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

#FORCE HTTPS ON ALL PAGES except for pageid 130
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} !(^|&)pageid=(130)($|&)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

哈哈!小错误但很难发现:您仍然重定向到https;。只需删除“s”

否则可能会确定重定向并停止重写过程=最后一次=L