简单的.htaccess 301重定向多个页面
所以我的 .htaccess 文件看起来像这样
RewriteBase /
Redirect 301 /page.html http://www.yoursite.com/newpage.html
Redirect 301 /page2.html http://www.yoursite.com/newpage.html
,它不会重定向我的 page.html
,如果我保留它,
RewriteBase /
Redirect 301 / http://www.yoursite.com/newpage.html
它就会工作,并重定向我的所有网站。现在为什么不起作用,相信我,我在 .htaccess 文件附近有 page.html,令人沮丧的是我有 10 个 .html 之类的东西要重定向,而不是更多......:(
任何人都可以帮助我吗?
So my .htaccess file looks like this
RewriteBase /
Redirect 301 /page.html http://www.yoursite.com/newpage.html
Redirect 301 /page2.html http://www.yoursite.com/newpage.html
and it doesn't redirect my page.html
and if i leave it
RewriteBase /
Redirect 301 / http://www.yoursite.com/newpage.html
it works, and redirect all my website. Now why is not working, and believe me, i have page.html near .htaccess file, and the frustation is that i have somthing like 10 .html to redirect, not more ... :(
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获得等效结果,您可以将其添加到任何其他规则之前的 .haccess 文件中。
To get the equivalent result you can add this to your .haccess file before any other rules.