如何在.htaccess中定义这个RewriteRule
我想将以下网址重写为另一个网址。
domain.com/abc 到 domain.com/news.php?name=123
我在 .htacesss 文件中定义了以下规则。
RewriteRule abc /news.php?name=123 [PT]
它有效,但我只想将“domain.com/abc”重写为 /news.php?name=123 我现在所拥有的将匹配任何包含“abc”的单词并重写到目的地。
有什么建议吗?
I want to rewrite the following url into another one.
domain.com/abc to domain.com/news.php?name=123
I defined the following rule in my .htacesss file.
RewriteRule abc /news.php?name=123 [PT]
It works but I only want "domain.com/abc" rewrite to /news.php?name=123
What I have now will match any words which contains "abc" and rewrite to destination.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
希望这应该有效。如果没有,请告诉我。
Hopefully this should work. Let me know if it doesn't.
尝试以下:
Try below: