【问题标题】:.htaccess 500 internal server error.htaccess 500 内部服务器错误
【发布时间】:2013-02-06 20:31:52
【问题描述】:

每当我在我的 WAMP 服务器 www 文件夹中应用 .htaccess 文件时,它都会显示:

Internal Server Error 服务器遇到内部错误或 配置错误,无法完成您的请求。请 联系服务器管理员,站长@http://www.domain.com 并告知他们错误发生的时间,以及您可能会做的任何事情 这样做可能会导致错误。有关此的更多信息 服务器错误日志中可能会出现错误

我的 .htaccess 文件是:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^finduser/(.*)/(.*)/$ finduser/finduserResult.php?City=$1&txtAreaRzip=$2 [L,NC]

hhtpd.conf 文件: 我已经启用了 LoadModule rewrite_module modules/mod_rewrite.so。

【问题讨论】:

  • 是否为 apache 启用了 mod_rewrite?
  • 那么错误日志中的内容是什么?
  • 检查你的 apache 错误日志,它在说什么?
  • 您的 .htaccess 文件没问题。试试@MarkoD 的建议。考虑将重写指令包装在 IfModule 标记中:<IfModule mod_rewrite.c></IfModule>

标签: php apache .htaccess


【解决方案1】:

确保您的 wamp rewrite_modue 已开启..

在 APACHE > APACHE 模块中 > rewrite_module

【讨论】:

    【解决方案2】:

    您需要设置以下设置: 在htaccess中

    php_flag display_errors on
    

    在php脚本中需要添加

    error_reporting(-1);
    ini_set('display_errors', 1);
    

    你会收到错误信息

    【讨论】:

      【解决方案3】:

      试试这个功能

      RewriteEngine On 
      Options All -Indexes
      RewriteBase /directoryname/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      

      然后尝试设置 sh4040 插件

      【讨论】:

        【解决方案4】:

        请检查错误日志进入目录 cd /var/log/apache2 type ls -->enter.如果您有错误 .htaccess: Invalid comman$

        通过运行命令解决了这个问题。

        sudo a2enmod rewrite && sudo service apache2 restart
        

        【讨论】:

          猜你喜欢
          • 2016-09-22
          • 2017-04-05
          • 1970-01-01
          • 2015-06-28
          • 2016-04-20
          • 2014-01-01
          • 2018-05-10
          • 2011-07-09
          相关资源
          最近更新 更多