htaccess 重定向 url 到页面
我想使用 301 重定向特定页面,但我的 htaccess 也重定向包含相同开头的页面。
示例:
我想重定向:
至:
我当前的规则is
RewriteRule ^advantage "index.php?page=some advantage" [L,R=301]
此规则还重定向
前往“一些优势”页面
如何我要解决这个问题吗?
I want to redirect a particular page using a 301 but my htaccess is also redirecting pages that contain the same start.
Example:
I want to redirect:
To:
http://domain.com/index.php?page=some advantage
My current rule is
RewriteRule ^advantage "index.php?page=some advantage" [L,R=301]
This rule also redirects
To the "some advantage" page
How do I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
^advantage
应该是^advantage$
即不是“开始,然后优势”,而应该是“开始,然后优势,然后结束”。
^advantage
should be^advantage$
i.e. Instead of "Start, then advantage" it should be "Start, then advantage, then End".
此站点是使用 mod_rewrite 的专家。看看吧。如果你要处理很多重写规则,他有很多资源。然而,无论大卫说什么都应该适用于上述问题
This site is an expert on using mod_rewrite. Have a look at it. He is got lot of resources, if you are dealing with lot of rewrite rules. However whatever David said should work for the above question