[英]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.