Forum: NGINX apache rewrite to nginx rewrite

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5032363ab6ccdfe0939522c6499f4326?d=identicon&s=25 杨廷勇 (Guest)
on 2009-03-06 04:02
(Received via mailing list)
apache rewrite rules

RewriteBase /
RewriteCond %{REQUEST_URI}    !\.(gif|jpeg|png|jpg|bmp)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
A6a197ee96a2939f320fa7ac33bdb144?d=identicon&s=25 raptium (Guest)
on 2009-03-06 05:58
(Received via mailing list)
Why you never read others' threads? Someone just asked the same
question and got the answer yesterday.

- Hide quoted text -
On Thu, Mar 05, 2009 at 01:38:45PM +0800, Weibin Yao wrote:

> These are rewrite rules for apache:
> RewriteBase /
> RewriteCond %{REQUEST_URI}    !\.(gif|jpeg|png|jpg|bmp)$
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . index.php [L]
> How to change these rules for nginx?

If you use FastCGI and nginx 0.7.x:

location / {
   try_files      $uri  $uri/  @php;

location ~ \.(gif|jpe?g|png|bmp)$ {

location @php {
   fastcgi_pass   ...;

   fastcgi_param  SCRIPT_FILENAME  /path/to/index.php;

   ... other fastcgi_param

2009/3/6 杨廷勇 <>:
This topic is locked and can not be replied to.