2014-10-18 119 views
0

我的網站網址是http://localhost/Apps/index.php;它工作正常,沒有.htaccess文件,但是當我添加.htaccess,我收到以下錯誤:.htaccess文件導致內部服務器錯誤

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

.htaccess文件的代碼是

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-l 

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

PHP錯誤日誌:

[18-Oct-2014 10:32:34 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found. in Unknown on line 0

Apache error.log:

[Sat Oct 18 06:51:11.609106 2014] [core:alert] [pid 3068:tid 960] [client ::1:3539] C:/wamp/www/Apps/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

我正在使用WAMP服務器。我的文件目錄是:C:\ wamp \ www \ Apps \ index.php Apps文件夾還包含一個.htaccess文件。

+0

檢查您的服務器錯誤日誌,看看發生了什麼。 – JimL 2014-10-18 20:22:43

+0

我不確定我的代碼。這是我的第一個代碼。當我刪除我的.htaccess文件,我的網站運行良好。 – 2014-10-18 20:38:54

回答

0

mod_reqrite是否已激活? 如果不在你的httpd.conf中,通過添加或修改這個: LoadModule rewrite_module modules/mod_rewrite.so 否則檢查你的日誌並將它們添加到你的文章。

+0

這裏是錯誤日誌: php_error.log: [18-Oct-2014 10:32:34 UTC] PHP警告:PHP啓動:無法加載動態庫'c:/wamp/bin/php/php5.5.12 /ext/php_ldap.dll' - 找不到指定的模塊。 在未知在線0 apache_error.log是: [星期六06年10月18日:51:11.609106 2014] [芯:警報] [PID 3068:TID 960] [客戶端:: 1:3539] C:/ wamp/www/Apps/.htaccess:無效的命令'RewriteEngine',可能是拼寫錯誤或未包含在服務器配置中的模塊定義的 時間無關緊要,它們是當前的錯誤。 謝謝。 – 2014-10-18 20:54:44

+0

安裝xampp;) – Cr41s3 2014-10-18 21:00:09

+0

[Sat Oct 18 06:51:11.609106 2014] [core:alert] [pid 3068:tid 960] [client :: 1:3539] C:/wamp/www/Apps/.htaccess:無效命令'RewriteEngine',可能拼錯或由未包含在服務器配置中的模塊定義 – 2014-10-18 21:00:47

相關問題