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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Steffen Lindner
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



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Igor Sysoev
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/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to remove quotation mark

mangoo
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


Loading...