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


#1

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.

Thx in advance!

Gomez


#2

I’ve set a cookie with slash, so browser automatic add quotation marks
to
the string.
So how to remove these quotation marks by following rule:
set $path “”;
if ($http_cookie ~ “pp=([^;]+)(?:;|$)”) {
set $path $1;
}
sub_filter pp $path;

Firstly, set a cookie with value test/opt, and browser will set it to
“test/opt”,
Then $http_cookie will get “test/opt”. In fact, we don’t need quotation
marks.

Definitely, these quotation marks should not be passed to $http_cookie.

How to avoid it?

Thanks in advance!

Regards
Mangoo


#3

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

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/;
}