【问题标题】:How to create htaccess rewrite rules for 301-redirects如何为 301 重定向创建 htaccess 重写规则
【发布时间】:2021-05-19 23:52:21
【问题描述】:

我需要 301 将一些页面从我的旧域重定向到具有另一个目录结构的新域。如何为这样的条件创建 .htacess 重写规则:

http://www.name.domain/product1.html

https://another-name.else-domain/language-1/catalog/product-1

http://www.name.domain/product2.html 到

https://another-name.else-domain/language-2/catalog-2/product-2

http://www.name.domain/ 或者 http://name.domain/

https://another-name.else-domain/homepage/

http://www.name.domain/any-else-pages

https://another-name.else-domain/

【问题讨论】:

    标签: .htaccess redirect url-rewriting


    【解决方案1】:

    在大多数情况下,您可以使用几个选项在 htaccess 中重定向。如果它的所有 URL Redirect 301 / https://example.com/ 用于单个 URL Redirect /path/to/old/file/old.html https://www.example.com/new/file/new.html。希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2013-01-21
      • 1970-01-01
      • 2012-11-07
      • 1970-01-01
      • 2010-12-22
      • 2011-01-05
      • 1970-01-01
      相关资源
      最近更新 更多