Rewrite problem with " "

Malte Sussdorff malte.sussdorff at
Wed Aug 22 21:00:33 MSD 2007

Sorry for this newbie question:

I need to rewrite /photos/%20/robots.txt to /robots.txt (and  
robots.txt is just an example). I tried it many ways, the latest was:

       location /photos/%20/ {
             rewrite ^/photos/%20/(.*)$ /$1 break;

What am I missing here? is the %20 which marks a space a problem ?

Thanks for your excellent answers

More information about the nginx mailing list