【问题标题】:URL rewrite using .htaccess (specific one)使用 .htaccess 重写 URL(具体一个)
【发布时间】:2013-07-03 16:18:14
【问题描述】:

需要帮助使用 .htaccess 文件重写 URL。新网站在 URL 中丢失了“dovanos”一词,我想保存我的客户并通过 seo 将他们重定向到正确的页面。

我有几千个这样的 URL:

www.example.com/dovanos/category1/item1.html

www.example.com/dovanos/category1/item2.html

www.example.com/dovanos/category2/item1.html

www.example.com/dovanos/category2/item2.html

等等。需要重写它们,使它们松散“dovanos”这个词:

www.example.com/category1/item1.html

www.example.com/category1/item2.html

www.example.com/category2/item1.html

www.example.com/category2/item2.html

有人可以帮忙吗?谢谢!

【问题讨论】:

    标签: .htaccess url rewrite


    【解决方案1】:
    RewriteEngine on
    RewriteRule ^dovanos/(.*)\.html$ $1.html [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-03
      • 2014-12-23
      • 2015-01-25
      • 1970-01-01
      相关资源
      最近更新 更多