atom feed22 messages in ru.sysoev.nginxRE: rewriterules
FromSent OnAttachments
John MccarthyApr 20, 2009 9:33 pm 
AMP AdminApr 20, 2009 10:05 pm 
John MccarthyApr 20, 2009 10:38 pm 
John MccarthyApr 20, 2009 11:07 pm 
Igor SysoevApr 21, 2009 12:12 am 
AMP AdminApr 21, 2009 10:30 am 
Igor SysoevApr 21, 2009 1:34 pm 
AMP AdminApr 21, 2009 1:59 pm 
Igor SysoevApr 22, 2009 4:50 am 
AMP AdminApr 22, 2009 6:52 am 
Igor SysoevApr 22, 2009 6:56 am 
AMP AdminApr 22, 2009 7:38 am 
Igor SysoevApr 22, 2009 7:45 am 
AMP AdminApr 22, 2009 8:47 am 
Igor SysoevApr 22, 2009 9:25 am 
AMP AdminApr 22, 2009 9:16 pm 
Jim OhlsteinApr 22, 2009 9:44 pm 
AMP AdminApr 23, 2009 5:53 am 
Nuno MagalhãesApr 23, 2009 6:01 am 
AMP AdminApr 24, 2009 6:44 am 
Igor SysoevApr 24, 2009 8:50 am 
AMP AdminApr 24, 2009 9:21 am 
Subject:RE: rewriterules
From:AMP Admin (adm@ampprod.com)
Date:Apr 24, 2009 9:21:20 am
List:ru.sysoev.nginx

Sorry, I forgot a line: RewriteCond %{REQUEST_URI} !(index\.php|\.css) [NC] RewriteRule ^(archive|sitemap)/(.*)$ $1/index.php/$2 [QSA,L]

-----Original Message----- From: owne@sysoev.ru [mailto:owne@sysoev.ru] On Behalf Of Igor Sysoev Sent: Friday, April 24, 2009 10:51 AM To: ngi@sysoev.ru Subject: Re: rewriterules

On Fri, Apr 24, 2009 at 08:44:36AM -0500, AMP Admin wrote:

Sorry for a simple question but I'm just not that good at regex and nginx yet. Can someone help me convert the .htaccess rewrite to nginx?

RewriteRule ^([a-z0-9_\-]*-(f|all)[0-9]+(p[0-9]+|/index[0-9]*)?\.html)$ page.php/$1 [QSA,L] RewriteRule ^([a-z0-9_\-]*-(t|p)[0-9]+(p[0-9]+|/index[0-9]*)?\.html)$ page.php/$1 [QSA,L] RewriteCond %{REQUEST_URI} !(index\.php|\.css) [NC]

It seems your rules are not complete. What is after

RewriteCond %{REQUEST_URI} !(index\.php|\.css) [NC]

?

The first two rules:

location / { rewrite ^/([\w\-]*-(f|all)\d+(p\d+|/index\d*)?\.html)$ /page.php/$1;

rewrite ^/([\w\-]*-(t|p)\d+(p\d+|/index\d*)?\.html)$ /page.php/$1;