我具有以下设置阿帕奇mod_rewrite的[R,C]不工作
RewriteCond %{REQUEST_URI} ^/search.php$
RewriteCond %{QUERY_STRING} ^what=(.*)&where=(.*)$
RewriteRule^/%1/%2? [R=302]
采用这种设置一切工作作为例外
example.com/search.php?what=foo &其中=巴
改写为
example.com/foo/bar
但是我还需要再次打的search.php,所以我说
RewriteCond %{REQUEST_URI} ^/search.php$
RewriteCond %{QUERY_STRING} ^what=(.*)&where=(.*)$
RewriteRule^/%1/%2? [R=302,C]
RewriteRule^/search.php?what=$1&where=$2 [L]
现在是“跳过”重定向和重写
从 example.com/search.php?what=foo &哪里= bar 至 example.com/search.php?what=foo & where = bar
重定向不能用C标志吗?
对不起,这是不是一种选择。我需要将example.com/search.php?what=foo&where=bar重写为example.com/foo/bar,但我希望将example.com/foo/bar重写为example.com/search.php?what=foo&where =酒吧 – Rooterle