Add slash to the end of every url (rewrite rule)

Igor Sysoev is at rambler-co.ru
Sat Mar 14 23:40:42 MSK 2009


On Sat, Mar 14, 2009 at 07:06:28PM +0100, Steffen Lindner wrote:

> Hi list,
> 
> i am a little bit lost in rewirt rules / regex.
> 
> I try to get an "/" to every urls end.
> 
> For better understanding check this:
> 
> http://3much.schnickschnack.info/art/projekte
> 
> If u press on a small thumbnail under the big picture it reloads and
> shows this url:
> 
> http://3much.schnickschnack.info/art/projekte/#0
> 
> If i now have a slash on all urls (on the end) it would work without
> a reload of the site.
> 
> I use ngnix 0.7.30. The CMS is plone.
> 
> Hope someone can help.

location ~ [^/]$ {
    rewrite  ^  http://site.com$uri/;
}


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list