编辑: Problem solved, see comment. 原帖:我需要将 /foo.html 重定向到 newsite.com/foo/ ,因为新网站是使用/ page / -style永久链接在wordpress中构建的 .
我试图在.htaccess中映射旧页面
Redirect 301 /foo.html http://www.newsite.com/foo/
但他们决心
http://www.newsite.com/foo.html?q=foo.html
给出404错误 .
我的语法有什么问题吗?
1 回答
(1)使用Redirect我需要注释掉所有Rewrite命令 . 重定向和重写不应该像我从here那样学到的 .
(2)使用Redirect不是将页面从旧站点映射到新站点的最佳实践,因为我无法提供回退 . 因此,我切换到Rewrite语句:
...以防万一其他人偶然发现我的问题