xxyuri 0 Newbie Poster

nginx server
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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.