【发布时间】:2019-03-15 06:18:06
【问题描述】:
我们正在为客户重建一个从 ASP 到 WordPress 的网站。该网站将具有不同的域、url 结构和文件扩展名。我只是对 htaccess 301 重定向有所了解,而且我知道我不能执行以下操作:
Redirect 301 http://www.site1.com/about_us.asp https://site2.com/about/
Redirect 301 http://www.site1.com/art-specs/ https://site2.com/specs/
Redirect 301 http://www.site1.com/page/product1/ https://site2.com/product1/
总共有大约 12 个链接需要重定向,我想确保它在第一时间就正确完成,因为客户的 SEO 排名在线。
我可以使用上述格式的变体吗?还是需要先完成的重写规则?任何帮助(和解释)将不胜感激!
【问题讨论】:
-
简单查看 apache 的 alias 模块的优秀文档会告诉你
Redirect指令的第二个参数是 path,而不是 URL : httpd.apache.org/docs/2.4/mod/mod_alias.html#redirect