【问题标题】:htaccess redirect url with special characters (+)带有特殊字符 (+) 的 htaccess 重定向 url
【发布时间】:2019-01-05 13:24:09
【问题描述】:

我有一个这样的网址。

http://olddomain.com/product-category/x-tended+bottoms/

我想通过 htaccess 将 301 重定向应用到 http://newdomain.com/shop/extended-bottoms

但是,当我尝试应用这样的规则时,它不会生效,而是让我进入未找到的页面。

RedirectMatch 301 ^/product-category/x-tended+bottoms/(.*)$ https://mothersenvogue.com.hk/shop/all-bottoms?

我可以使用什么正则表达式来更改网址上的加号 (+)?

【问题讨论】:

    标签: wordpress .htaccess mod-rewrite


    【解决方案1】:

    因此,我可以通过添加突出显示的规则来检查 URL 上的加号 (+),从而找到问题的参考答案:

    RedirectMatch 301 ^/product-category/x-tended**[\s+]**bottoms/$ https://newdomain.com/?$
    

    htaccess redirect a plus sign

    【讨论】:

      猜你喜欢
      • 2016-04-13
      • 1970-01-01
      • 2018-05-12
      • 2015-05-19
      • 1970-01-01
      • 2013-06-08
      • 1970-01-01
      • 1970-01-01
      • 2017-10-30
      相关资源
      最近更新 更多