According to "What is matched?" in the mod_rewrite docs, the query string (part after the ?) is separated out into the QUERY_STRING variable, which then has to be tested separately from the main part of the URL. In RewriteCond, the parameter value is captured by the regular expression within the parentheses (.*), and is then available as %1 in the RewriteRule.
发布评论
评论(1)
是的。试试这个:
根据“匹配什么?”在 mod_rewrite 文档 中,查询字符串(< code>?) 被分离到
QUERY_STRING
变量中,然后必须将其与 URL 的主要部分分开进行测试。在RewriteCond
中,参数值由括号(.*)
内的正则表达式捕获,然后在重写规则
。Yes. Try this:
According to "What is matched?" in the mod_rewrite docs, the query string (part after the
?
) is separated out into theQUERY_STRING
variable, which then has to be tested separately from the main part of the URL. InRewriteCond
, the parameter value is captured by the regular expression within the parentheses(.*)
, and is then available as%1
in theRewriteRule
.