how to rewrite this: apache to nginx

Igor Sysoev is at rambler-co.ru
Fri Aug 29 13:16:58 MSD 2008


On Fri, Aug 29, 2008 at 11:13:20AM +0200, Robert Gabriel wrote:

> But what about this?
> 
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . index.php [L]

    location / {
        error_page  404 = /index.php;
    }

> Igor Sysoev wrote:
> > On Fri, Aug 29, 2008 at 10:54:38AM +0200, Robert Gabriel wrote:
> > 
> >> RewriteRule ^(.*/)?libs(/|$) - [F,L]
> >> RewriteRule ^(.*/)?plugins(/|$) - [F,L]
> >> RewriteRule ^(.*/)?storage(/|$) - [F,L]
> >> RewriteRule ^(.*/)?templates(/|$) - [F,L]
> >> 
> >> to nginx?!
> > 
> > server {
> > 
> >     root ...
> > 
> >     location / {
> >         error_page  404 = /index.php;
> >     }
> > 
> >     location ~* \.php$ {
> >         ...
> >     }
> > 
> >     location ~* ^(.*/)?(\.svn|api|libs|plugins|storage|templates)(/|$) {
> >         return  403;
> >     }


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





More information about the nginx mailing list