urlencode for rewrite rules

Andy Triboletti andy.triboletti at gmail.com
Wed Mar 7 06:28:01 MSK 2007


Hi, I'm trying to put one url inside another url with a rewrite rule, but I
want to make sure the embedded url is url encoded.  Is there a way to do
this with nginx?  I think mod_rewrite does this automatically, but I'm not
sure.


rewrite ^(.*)$ /the_real_file?referer=$http_referer redirect;

This makes urls like
/the_real_file?referer=http://www.gmail.com?foo=bar

I want the urls to look like:
/the_real_file?referer=http%3A%2F%2Fwww.gmail.com%3Ffoo%3Dbar


I can't get the the referer out of the header cause it's a flash movie, so
I'm trying to do this trick with appending the referer onto the  request as
a query param.

Thanks,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20070306/d97abcac/attachment.html>


More information about the nginx mailing list