1

如何将 .htaccess 配置转换为 nginx?

我的.htacess:

Options -MultiViews
RewriteEngine On
RewriteBase /mvc/public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

我试过这个:

nginx配置

location /mvc/public/ {
if (!-e $request_filename){
rewrite ^/mvc/public/(.+)$ /mvc/public/index.php?url=$1 [QSA,L];
}
}

但这没有用!有人可以帮助我吗?

4

1 回答 1

2
于 2016-03-22T10:19:41.167 回答