将apache重写规则转换为nginx

时间:2014-09-11 20:29:23

标签: apache .htaccess mod-rewrite nginx

你能帮忙转换这些重写吗?

 RewriteEngine On
 RewriteBase /         
 RewriteCond %{REQUEST_URI} !^(payment|admin|provider|partner)/
 RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-l
 RewriteRule ^(.*)$ dispatcher.php [L]

我尝试了一些在线转换,但它们无法正常工作。

1 个答案:

答案 0 :(得分:0)

尝试:

location ~ (payment|admin|provider|partner)/ { 

} 
location / { 
  if (!-e $request_filename) { 
    rewrite ^(.*)$ /dispatcher.php break; 
  } 
}