url重写正则表达式问题

发布于 2024-09-28 12:51:10 字数 308 浏览 0 评论 0原文

我的 isapi 重写正则表达式没有在 URL 中传递变量

尝试传递如下变量:www.domain.com/z34232/ProductName.html?ref=magic

但代码忽略了“ref=magic”字符串

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

任何建议都会非常有帮助。我需要保持绳子的其余部分完好无损。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心不设防 2024-10-05 12:51:10

我认为你试图实现这样的目标:

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

I think you trying to achieve something like this:

RewriteRule .*z([0-9]*)/.*\.html(\?.*)? /product.asp?pnum=$1$2 [QSA]
顾冷 2024-10-05 12:51:10

您不能使用模式来匹配查询字符串。类似以下内容应该有效:

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

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}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文