开发者

url rewrite regex question

My regex expression for isapi rewrite here isn't passing variables in the URL

Trying to pass a variables like: www.domain.com/z34232/ProductName.html?ref=magic

But the code is ignoring the "ref=magic" string

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

Any suggestions would be开发者_如何学编程 extremely helpful. I need to keep the rest of the string intact.


I think you trying to achieve something like this:

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


You can't use the pattern to match the query string. Something similar to the following should work:

RewriteRule .*/z([[:digit:]]*)/.*\.html  /product.asp?pnum=$1&%{QUERY_STRING}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜