通过 htaccess 中的 RewriteRule 到 url 的简单 url 不起作用
我需要将一个 URL 重定向到另一个 URL,不带任何参数或任何内容
domain.com/snow to
superdomain.com/longer/url/snow em>
我正在尝试在 .htaccess 中使用以下内容:
RewriteRule ^snow http://superdomain.com/longer/snow [R=301,L]
或
RewriteRule ^snow$ http://superdomain.com/longer/snow [R=301,L]
但它们都不起作用,知道我错过了什么吗?
注意:网址只是示例,但它们的结构与我需要的相同
I need to redirect a single URL to another single URL, no parameters or anything
domain.com/snow to
superdomain.com/longer/url/snow
i am trying with, in .htaccess the following:
RewriteRule ^snow http://superdomain.com/longer/snow [R=301,L]
or
RewriteRule ^snow$ http://superdomain.com/longer/snow [R=301,L]
But none of them are working, any idea what am I missing?
Note: the url's are only examples but they have same structure than what i need
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
刚刚发现! /snow/ flolder 有自己的 .htacess :)
just found out! /snow/ flolder had its own .htacess :)
如果您不需要参数或任何内容,RedirectPermanent是一个更简单的选择:
If you don't need parameters or anything, RedirectPermanent is a simpler option: