2013-02-07 46 views
-1

我得到404錯誤,轉換阿帕奇Nginx的htaccess的後,貝婁是我的htaccess代碼如何寫nginx的清潔網址的htaccess 0.7.65

RewriteEngine On 
Options +FollowSymlinks 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?$1 [L] 

請幫助我,我learnet

回答

1

編輯你的nginx.conf並在你的虛擬主機中加入這一行

 location/
    { 
    if (!-e $request_filename) 
    { 
     rewrite ^(.*)$ /index.php?$1 break; 
    } 
    } 
+1

有沒有其他方法可以做到這一點? – Anudeep

+1

請幫我im被困.. – Anudeep

+1

在nginx中沒有什麼像.htaccess ...但是你需要編輯nginx.conf可能位於/etc/nginx.conf中,如果使用軟件包管理器如yum或apt-get ..如果你使用的源碼比nginx.conf的默認位置安裝的是/usr/local/nginx/etc/nginx.conf –