【发布时间】:2014-11-27 12:41:15
【问题描述】:
我已将 2 个网站合并为一个。我已经为停用网站 (hkgolf.co.uk) 上的所有页面设置了 .htaccess 重定向,以重定向其他网站 (http://harriskalinka.com) 上的等效页面。
这是我在停用网站上的 .htaccess 中拥有的:
Redirect 301 / http://harriskalinka.com/
Redirect 301 /work/ http://harriskalinka.com/work/
Redirect 301 /projects_tag/academy/ http://harriskalinka.com/work/
Redirect 301 /projects_tag/asia/ http://harriskalinka.com/work/
我想做的是将访问旧网站主页的访问者重定向到新网站上的一个页面,告诉他们重定向的原因,并让所有其他重定向正常工作。所以我这样做了:
Redirect 301 / http://harriskalinka.com/home/hk-golf-redirect/
Redirect 301 /work/ http://harriskalinka.com/work/
Redirect 301 /projects_tag/academy/ http://harriskalinka.com/work/
Redirect 301 /projects_tag/asia/ http://harriskalinka.com/work/
现在发生的情况是,如果您转到旧网站主页 (hkgolf.co.uk/),您将被重定向到 http://harriskalinka.com/home/hk-golf-redirect/(我想要的)
问题是,如果您访问 hkgolf.co.uk/work/,您会被发送到 http://harriskalinka.com/home/hk-golf-redirect/work/ 而不是 http://harriskalinka.com/work/
为什么会这样?
【问题讨论】:
标签: apache .htaccess redirect url-redirection