【问题标题】:Nginx URL rewrite with spaceNginx URL 用空格重写
【发布时间】:2017-08-01 23:22:00
【问题描述】:

我有一个 URL /test/space,我想将它重定向到正确的 URL /test/ 在 Nginx 上

我试过了 重写 ^/test/%20 /test 重定向;

没有结果有什么想法吗?

【问题讨论】:

    标签: redirect nginx


    【解决方案1】:

    在到达rewrite 语句时,URL 编码的字符已经被解码。您只需将其括在引号中:

    rewrite "^/test/ " /test redirect; 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-07
      • 1970-01-01
      • 1970-01-01
      • 2019-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多