0

如果我有两个或更多子目录,我在添加斜杠时遇到问题

rewrite ^/([^.]*[^/])$ $1/ permanent; //this is working example if I have one directory

如果我有两个或多个子目录,如何添加斜杠?

http://example.com/foo/foo2/
http://example.com/foo/foo2/

4

1 回答 1

0

捕获不带有斜杠的所有内容,并为其添加斜杠。

rewrite ^(.*[^/])$ $1/ permanent;
于 2012-03-06T22:07:26.773 回答