doupian6118
2014-10-18 20:20
浏览 271
已采纳

.htaccess文件导致内部服务器错误

My site url is http://localhost/Apps/index.php; it works fine without an .htaccess file, but when i add an .htaccess, I receive the following error:

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.

My .htaccess file code is

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-l

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

PHP Error log:

[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

I am using a WAMP server. My file directory is: C:\wamp\www\Apps\index.php the Apps folder also contains a .htaccess file.

图片转代码服务由CSDN问答提供 功能建议

我的网站网址是 http://localhost/Apps/index.php ; 它没有 .htaccess 文件,但是当我添加 .htaccess 时,我收到以下错误:

内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请通过admin@example.com与服务器管理员联系,告知他们此错误发生的时间以及您在此错误发生之前执行的操作。

服务器错误日志中可能会提供有关此错误的更多信息。

我的。 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警告:PHP启动:Unab le加载动态库'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - 找不到指定的模块。 在第0行的未知中

Apache error.log:

[星期六10月18日06:51:11.609106 2014] [核心:警报] [pid 3068:tid 960] [客户端:: 1:3539] C:/wamp/www/Apps/.htaccess:无效命令'RewriteEngine',也许 拼写错误或由未包含在服务器配置中的模块定义

我正在使用WAMP服务器。 我的文件目录是:C:\ wamp \ www \ Apps \ index.php Apps文件夹还包含.htaccess文件。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongluan5740 2014-10-18 20:29
    已采纳

    Is the mod_reqrite activated? If not do so in your httpd.conf , by adding or modifying this: LoadModule rewrite_module modules/mod_rewrite.so Else check your logs and add them to your post.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题