2016-11-18 69 views
-1

快速問題的htaccess大師在那裏。爲nginx轉換htaccess

如何將這個.htaccess文件轉換爲nginx?

<IfModule mod_rewrite.c> 
RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 

</IfModule> 

回答

1

在您的location /指令中使用您的其他規則嘗試此規則。

location/{ 
    rewrite ^(.*)$ index.php?url=$1 last; 
} 

然後重新加載或重新啓動服務器。

+0

沒有,這似乎沒有工作,甚至根路由失敗,在這個重寫 – JonnySerra

+0

你能告訴我你應用規則的完整指令。 –