Welcome! Log In Create A New Profile

Advanced

unescaping character in url

Fr Tr
October 24, 2009 10:52AM
Hi all,

I have a problem trying to rewrite a URL.

It should be pretty straightforward but it has been taking me hours
searching.

Google indexed urls containing ";", which gets escaped to %3B:

http://server.com/plan/52%3Bjsessionid=A9594B224FF913C1A1AB83B0368C1581
(the original url that works is
http://server.com/path/52;jsessionid=A9594B224FF913C1A1AB83B0368C1581)

First approach was:
server {

location /plan/ {
rewrite /plan/(.*)%3Bjsessionid=[A-Za-z0-9]+(.*)
http://www.server.com/plan/$1$2 permanent;
}
(...)
}

but no dice, I get errors because it tries to fetch a file from disk (!)
/usr/local/nginx/html/plan/52" failed (2: No such file or directory),

Just to test I tried also with

if ($args ^~ jsessionid){
rewrite ^ http://example.com/ permanent;
}

....but it doesn't like the ^~ which btw means the wiki for
NginxHttpRewriteModule is outdated for 0.6.29.

My question is: how can I simply do a rewrite to replace "%3B" to ";" ?

Thanks!

Francisco
--
Posted via http://www.ruby-forum.com/.
Subject Author Posted

unescaping character in url

Fr Tr October 24, 2009 10:52AM

Re: unescaping character in url

Maxim Dounin October 24, 2009 08:46PM

Re: unescaping character in url

Fr Tr October 25, 2009 06:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready