【问题标题】:Nginx Rewrite permanentNginx 重写永久
【发布时间】:2017-11-17 18:23:54
【问题描述】:

和以前一样

/movies/the-last-song.html

现在我有什么了:

/movie/the-last-song

目前我正在尝试这样做,但不起作用。

rewrite  ^/movies/(.*)$.html  /movie/$1  permanent;

感谢您的帮助。谢谢。

【问题讨论】:

    标签: redirect nginx rewrite


    【解决方案1】:

    删除正则表达式中的$ 符号。它代表行尾,所以.html 永远不会匹配。您还应该将. 转义为\.

    rewrite  ^/movies/(.*)\.html  /movie/$1  permanent;
    

    【讨论】:

      猜你喜欢
      • 2015-04-16
      • 1970-01-01
      • 2013-07-12
      • 2016-08-01
      • 2011-11-18
      • 1970-01-01
      • 1970-01-01
      • 2018-01-24
      • 1970-01-01
      相关资源
      最近更新 更多