【发布时间】:2014-03-27 06:42:21
【问题描述】:
这个允许所有带有 .html 扩展名且不包含斜杠的内容:
rewrite ^/([^/]+).html$ ...
我需要添加另一个捕获:URL 必须至少包含一个破折号,然后才能重写。
怎么做?
【问题讨论】:
-
rewrite ^/([^/]+-[^/]+)\.html$。你也忘了转义点(.) -
@alexeyten 谢谢,它有效。但是你在cmets写的时候怎么给你加分呢?
标签: nginx url-rewriting