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
Apache 重写P标志不起作用的规则_Apache_.htaccess_Mod Rewrite_Proxy - Fatal编程技术网

Apache 重写P标志不起作用的规则

Apache 重写P标志不起作用的规则,apache,.htaccess,mod-rewrite,proxy,Apache,.htaccess,Mod Rewrite,Proxy,我在.htaccess中放置了重写规则: RewriteCond %{HTTP_HOST} ^demo\.test\.ch$ [NC] RewriteRule (.*) http://www.test.ch/plu/sub/%{REQUEST_URI}?%{QUERY_STRING}&id=3 [P] 当我尝试访问url demo.test.ch时,在我的错误日志中有如下内容 demo.test.ch/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/pl

我在.htaccess中放置了重写规则:

RewriteCond %{HTTP_HOST} ^demo\.test\.ch$ [NC]
RewriteRule (.*) http://www.test.ch/plu/sub/%{REQUEST_URI}?%{QUERY_STRING}&id=3 [P]
当我尝试访问url demo.test.ch时,在我的错误日志中有如下内容

demo.test.ch/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/plu/sub/&id=3&id=3&id=3&id=3&id=3&id=3&id=3

直到我有一个比URL太长的错误

我的问题是:为什么我的代理复制到很多时候的url


谢谢。

为什么您的
RewriteCond
上有
[NC]
?这两种旗子在那里都没有意义。是的,没有[NC]会更好!!!现在我只有两次了!:D>demo.test.ch/plu/sub/plu/sub。。有没有办法知道为什么我有两次?我刚换了服务器,现在也有同样的问题-(…有人知道怎么弄明白吗?谢谢