【问题标题】:Redirect All Sub Pages to Same Place on New URL将所有子页面重定向到新 URL 上的相同位置
【发布时间】:2013-01-09 23:53:39
【问题描述】:

我想将博客从一个域重定向到另一个域。我已经设置了 URL 结构,因此它匹配所有页面。本质上,它将从 olddomain.com 到 newdomain.com/blog/(例如 http://www.olddomain.org/2013/01/blog-name/http://www.newdomain.org/blog/2013/01/blog-name/)。通过 .htaccess 执行此操作的最佳方法是什么?我尝试了一些我在网上找到的选项,但它们似乎只重定向主页而不是所有子页面。

谢谢!

【问题讨论】:

    标签: .htaccess redirect


    【解决方案1】:

    想通了。它是这样工作的:

    RewriteEngine on 
    RewriteRule ^(.*)$ http://www.newdomain.org/blog/$1 [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2012-05-25
      • 2012-03-25
      • 1970-01-01
      • 2014-09-23
      • 2019-09-07
      • 2017-11-19
      • 2020-07-17
      • 1970-01-01
      • 2012-11-19
      相关资源
      最近更新 更多