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

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

This makes urls like

I want the urls to look like:

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.

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