我对ISAPI重写的正则表达式在这里没有传递URL中的变量

尝试通过以下变量:www.domain.com/z34232/productname.html?ref =魔术

但是代码忽略了“ ref =魔术”字符串

  RewriteRule .*z([[:digit:]]*)\/.*.html\??(.*)  /product.asp\?pnum=$1(?2&$2&:) [I,O,L]

任何建议都会非常有帮助。我需要保持其余的字符串完整。

有帮助吗?

解决方案

我认为您试图取得这样的成就:

RewriteRule .*z([0-9]*)/.*\.html(\?.*)? /product.asp?pnum=$1$2 [QSA]

其他提示

您不能使用模式与查询字符串匹配。类似于以下情况应该有效:

RewriteRule .*/z([[:digit:]]*)/.*\.html  /product.asp?pnum=$1&%{QUERY_STRING}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top