【问题标题】:Redirecting old url traffic to new url using htaccess and 301 permanent moved [closed]使用 htaccess 将旧 url 流量重定向到新 url 和 301 永久移动 [关闭]
【发布时间】:2013-12-26 08:41:10
【问题描述】:

我正在尝试使用通过 .htaccess 的 301 永久移动指令将网站的旧网址更改为新网址

我想把所有的流量都改成新的url,也想告诉搜索引擎一些页面的新地址(哪个url改变了)

我用过

Redirect 301 / http://www.newdomain.com/
Redirect 301 /page1.html http://www.newdomain.com/page1/
Redirect 301 /page2.html http://www.newdomain.com/page2/
Redirect 301 /page3.html http://www.newdomain.com/page3/

但我得到的结果是最后三个指令重定向到

http://www.newdomain.com/page1.html and so

这里有什么我遗漏的东西,或者我需要做些什么来重定向流量并告诉每个页面的新网址是什么?

【问题讨论】:

    标签: html .htaccess redirect


    【解决方案1】:

    我实际上设法通过重新组织 htaccess 内容来解决这个问题

    Redirect 301 /page1.html http://www.newdomain.com/page1/
    Redirect 301 /page2.html http://www.newdomain.com/page2/
    Redirect 301 /page3.html http://www.newdomain.com/page3/
    RedirectMatch 301 /(.*) http://www.domaintoredirecto.com1
    

    工作...

    【讨论】:

      猜你喜欢
      • 2021-05-25
      • 1970-01-01
      • 1970-01-01
      • 2012-04-18
      • 1970-01-01
      • 2014-08-29
      • 1970-01-01
      • 2013-01-07
      • 2021-12-27
      相关资源
      最近更新 更多