【问题标题】:500 Internal Server Error : .htaccess500 内部服务器错误:.htaccess
【发布时间】:2015-06-28 05:05:53
【问题描述】:

我收到以下错误

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

请联系服务器管理员 webmaster@localhost 和 告知他们错误发生的时间,以及您可能会做的任何事情 这样做可能会导致错误。有关此的更多信息 错误可能在服务器错误日志中可用。 Apache/2.2.22 (Ubuntu) 服务器位于 111.118.254.188 端口 80

我在这里运行 XAMPP 服务器是我的 htaccess 文件,我不明白问题是什么。

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

【问题讨论】:

  • 您的 .htaccess 文件的文件权限是什么?
  • 你的 Apache 日志在说什么?
  • @talsibony - 请注意&lt;IfModule mod_rewrite.c&gt; 部分。只是不运行 mod_rewrite 不会触发 500 状态码。
  • 抛出 500 错误的原因有很多,甚至是您的 php 文件中的错误。第一步是检查您的错误日志。并尝试重命名您的 .htaccess 以确保它是导致错误的 .htaccess 文件。

标签: php apache .htaccess


【解决方案1】:

您应该添加 RewriteBase 来定义每个目录的前缀。

也尝试添加:

Options +FollowSymLinks

【讨论】:

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