Welcome! Log In Create A New Profile

Advanced

Re: How can add trailing slash if I have two or more subdirectories ?

Valentin V. Bartenev
March 04, 2012 07:08PM
On Monday 05 March 2012 02:50:43 Sputnik wrote:
> Problem to add trailing slash if I have two or more subdirectories
>
> rewrite ^/([^.]*[^/])$ $1/ permanent; //this is working example if I
> have one directory
>
> http://example.com/foo/ (with trailing slash, conventionally a
> directory)
> http://example.com/foo (without trailing slash, conventionally a file)
>
>
> How can add trailing slash if I have two or more subdirectories ?
>
> http://example.com/foo/foo2/
> http://example.com/foo/foo2
>

location ~ [^/]+/[^/]+$ {
return 301 $uri/;
}

wbr, Valentin V. Bartenev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
SubjectAuthorPosted

Re: How can add trailing slash if I have two or more subdirectories ?

Valentin V. BartenevMarch 04, 2012 07:08PM

Re: How can add trailing slash if I have two or more subdirectories ?

Edho AriefMarch 04, 2012 09:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 5 on May 22, 2013
Record Number of Guests: 150 on May 22, 2013
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready