Rewrite

Igor Sysoev igor at sysoev.ru
Sun Nov 29 23:28:42 MSK 2009


On Sun, Nov 29, 2009 at 01:21:14PM -0500, thinkbot wrote:

> Hello,
> 
> I wanted to rewrite this url
> 
> rss.xml?type=popular&cid=8 
> to
> /cache/rss/popular_8.xml
> 
> so I wrote
> 
>                 location ~* \.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
>                         root /home/site/public_html;
>                         access_log      off;
>                         expires      30d;
> 
>                         rewrite ^rss\.xml?type=popular&cid=(.*)$ /cache/rss/popular_8.xml break;
>                 }
> 
> But it doesn't work :/ 
> Can anyone help me out with this ? let me know what I'm doing wrong

     root /home/site/public_html;

     location = /rss.xml {
         if ($args ~ ^type=popular&cid=8) {
             rewrite ^  /cache/rss/popular_8.xml  break;
         }
     }


-- 
Igor Sysoev
http://sysoev.ru/en/




More information about the nginx mailing list