[英]Apache Redirection {QUERY_STRING} input is empty in Rewrite Cond
[英]Redirection with Apache2 query_string with square brackets
我有一个类似的网址
http://domain.net/documents?f[author]=43
应该重定向到
http://domain.net/documents/author/43
我到目前为止所拥有的是
RewriteEngine On
Rewritebase /documents
RewriteCond %{query_string} f([^/]+)=(.*)$ [NC]
RewriteRule (.*) author/%2? [R=301,L]
但是,当我只需要替换“?f”时,这会将包括http://domain.net/documents/author/43?page=1在内的所有URL重定向回http://domain.net/documents/author/43 。 [author] =“部分带有” / author /“
RewriteEngine On
Rewritebase /documents
RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteCond %{query_string} f([^/]+)=(.*)$ [NC]
RewriteRule (.*) author/%2? [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.