我的網站網址是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文件。
檢查您的服務器錯誤日誌,看看發生了什麼。 – JimL 2014-10-18 20:22:43
我不確定我的代碼。這是我的第一個代碼。當我刪除我的.htaccess文件,我的網站運行良好。 – 2014-10-18 20:38:54