【问题标题】:.htaccess rewrite example.com/store/page.html to domain.com/page.html.htaccess 将 example.com/store/page.html 重写为 domain.com/page.html
【发布时间】:2019-04-09 15:48:56
【问题描述】:

刚刚将网站迁移到其他平台。

旧网站有类似的网址,

https://www.example.com/store/product.html

https://www.example.com/store/product2.html

https://www.example.com/store/product3.html

新网站有类似的网址,

https://www.example.com/product.html

https://www.example.com/product2.html

https://www.example.com/product3.html

如何使用 htaccess 将旧网址 301 重定向到新网站的新布局格式?

【问题讨论】:

    标签: .htaccess mod-rewrite http-status-code-301


    【解决方案1】:

    你可以把这条规则放在你的htaccess中,它应该在根文件夹中

    RewriteEngine On
    RewriteRule ^store/([^/]+\.html)$ /$1 [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 2021-11-10
      • 1970-01-01
      • 2014-03-04
      • 2011-12-19
      • 2013-04-09
      相关资源
      最近更新 更多