无法使用 Apache RewriteRule
我想使用 Apache RewriteRule 将 URL 目标页面更改为 abc.php。我已将 RewriteEngine 设置为 On 但我发现了这个问题。
我使用的正则表达式:
RewriteRule ^viewthread\.php.tid=12345$ abc.php
要匹配的URL字符串:
viewthread.php?tid=12345
为什么没有成功匹配?
I would like to use Apache RewriteRule to change the URL target page to abc.php. I have set RewriteEngine On but I found this problem.
Regexp I used:
RewriteRule ^viewthread\.php.tid=12345$ abc.php
The URL string to match:
viewthread.php?tid=12345
Why it is not successfully matched?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用查询字符串重写 URL 比重写普通 URL 稍微复杂一些。您必须编写如下内容:
请参阅这些文章以获取更多帮助:
Rewriting URLs with query strings is slightly more complicated than rewriting plain URLs. You'll have to write something like this:
See those articles for more help:
我想是因为你错过了?在规则...
i think because you have missed the ? in the rule...
不应该是:
Shouldn't it be: