【发布时间】:2014-12-14 04:00:19
【问题描述】:
我的网址是http://localhost/Apps/index.php;没有.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 admin@example.com 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 错误日志:
[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 文件。
【问题讨论】:
-
检查您的服务器错误日志以了解发生了什么。
-
我不确定我的代码。这是我的第一个代码。当我删除我的 .htaccess 文件时,我的网站运行良好。
标签: php apache .htaccess mod-rewrite localhost