【问题标题】:htaccess Rewriting a URL with a commahtaccess 用逗号重写 URL
【发布时间】:2010-09-29 01:00:40
【问题描述】:

我需要将包含逗号的 url 重写为另一个 URL。原始 URL 还包含 +(加号),我发现需要用反斜杠对其进行转义,但逗号似乎无法正确读取。 它是这样的:

RewriteRule ^locations/New+York/Buffalo,\+Erie\+County,\+and\+Surrounding\+Areas$ "/locations/New+York/Buffalo" [R=301,NC]

【问题讨论】:

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


    【解决方案1】:

    我差点猜对了,你只是忘记逃跑第一个+

    RewriteRule ^locations/New\+York/Buffalo,\+Erie\+County,\+and\+Surrounding\+Areas$ "/locations/New+York/Buffalo" [R=301,NC]
    

    【讨论】:

      猜你喜欢
      • 2013-09-03
      • 2021-08-21
      • 1970-01-01
      • 2021-08-12
      • 1970-01-01
      • 1970-01-01
      • 2014-01-02
      • 2013-11-06
      • 1970-01-01
      相关资源
      最近更新 更多