【问题标题】:Server error! Error 500 when using .htaccess file服务器错误!使用 .htaccess 文件时出现错误 500
【发布时间】:2015-02-06 20:03:22
【问题描述】:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA, L]

我使用这个.htaccess 文件,当我访问http://localhost/sites/MVC/help 时,它不会返回到index.php,而是给出:

服务器错误!

服务器遇到内部错误,无法完成 你的申请。服务器超载或出现错误 一个 CGI 脚本。

如果您认为这是服务器错误,请联系网站管理员。

错误 500

localhost Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.19

【问题讨论】:

  • 检查您的错误日志
  • 您的问题是 rewrite_module 可能未加载。您应该检查 Apache 错误日志以查看问题的确切原因。将其附在这些标签内:<IfModule rewrite_module>/* You rewrite rules go here*/</IfModule>httpd.apache.org/docs/current/mod/core.html#ifmodule
  • 通常由 AllowOverride 设置为 None 而不是 All 引起
  • @LuckyBurger 实际上更有可能没有启用重写模块。如果 AllowOverride 设置为none,它将只是简单地忽略 htaccess 文件并且它不会被读取。

标签: php apache .htaccess


【解决方案1】:

启用您的重写模块。这将解决您的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-26
    • 2012-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-09
    相关资源
    最近更新 更多