301重定向无效

时间:2012-08-08 04:38:36

标签: .htaccess redirect

我有一个博客,我正在尝试重定向到其他域名。

  • 旧域名:http://harrisonfjord.com
  • 新域名:http://agoodman.com/blog/

Google表示您应该对所有网页执行301重定向,因此我从我的XML站点地图中获取了一个网址列表,并手动设置了重定向。

以下是我在.htaccess文件中添加的内容:http://pastebin.com/PkKNbJKf

两个域的文件结构相同,因此我可以简单地重定向每个页面,如下所示:

redirect 301 http://harrisonfjord.com/ http://agoodman.com.au

redirect 301 http://harrisonfjord.com/whatever http://agoodman.com.au/blog/whatever

然而,目前这不起作用。我是否需要将重定向放入标签或其他内容?

1 个答案:

答案 0 :(得分:1)

如果您将旧域重定向到新的新域名会怎样?

# redirect an entire site via 301
redirect 301 / http://agoodman.com/blog/

另请尝试使用RewriteEngine

RewriteEngine On
RewriteRule ^(.*)$ http://agoodman.com/blog/$1 [R=301,L]
相关问题