2015-02-06 97 views
0
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule ^(.+)$ index.php?url=$1 [QSA, L] 

我用這個.htaccess文件,當我訪問http://localhost/sites/MVC/help它不返回index.php但給:服務器錯誤!錯誤500當使用.htaccess文件

服務器錯誤!

服務器遇到內部錯誤,無法完成 您的請求。服務器超載或者在CGI腳本中出現錯誤 。

如果您認爲這是服務器錯誤,請與網站管理員聯繫。

錯誤500

本地主機的Apache/2.4.10(Win32的)的OpenSSL/1.0.1i PHP/5.5.19

+3

檢查你的錯誤日誌 – 2015-02-06 20:04:21

+0

你的問題是rewrite_module可能沒有加載。您應該檢查您的Apache錯誤日誌以查看問題的確切原因。將它們放在這些標記的內部:'/*您將重寫規則轉到此處*/'http://httpd.apache.org/docs/current/mod/core.html#ifmodule – MonkeyZeus 2015-02-06 20:05:46

+0

通常由AllowOverride設置爲None而不是全部 – geggleto 2015-02-06 20:32:54

回答

0

使您重寫模塊。這將解決你的錯誤。