【问题标题】:htaccess redirect a plus signhtaccess 重定向加号
【发布时间】:2014-11-19 12:25:14
【问题描述】:

我尝试将 URL 从旧站点重定向到新站点,但它不起作用。 我认为加号给我带来了问题。

  RewriteRule ^nl/pageid/junair+compressor+onderhoud(|/)$     /nl/persluchttechniek/page/nieuwsberichten/compressor-onderhoud-junair  [R=301,L]

【问题讨论】:

    标签: regex apache .htaccess mod-rewrite redirect


    【解决方案1】:

    在旧站点的根 .htaccess 中尝试此重定向规则:

    RewriteRule ^nl/pageid/junair[\s+]compressor[\s+]onderhoud/?$ /nl/persluchttechniek/page/nieuwsberichten/compressor-onderhoud-junair [NC,B<R=301,L]
    

    确保这是您在RewriteEngine 行下方的第一条规则。还要检查您的系统中是否没有其他 .htaccess。

    【讨论】:

      【解决方案2】:

      + 可能是 URL 编码的空格,尝试在模式中用 \s 替换它。

      RewriteRule ^nl/pageid/junair\scompressor\sonderhoud(|/)$     /nl/persluchttechniek/page/nieuwsberichten/compressor-onderhoud-junair  [R=301,L]
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-09
        • 1970-01-01
        • 2012-06-21
        相关资源
        最近更新 更多