【问题标题】:500 Internal Server Error error was encountered laravel on hosting500 内部服务器错误错误在主机上遇到 laravel
【发布时间】:2014-06-30 21:53:00
【问题描述】:

我无法访问我的网站。 “遇到 500 内部服务器错误错误”当我尝试访问我的根域(如 mydomain.com)时发生此错误

我的 .htaccess 文件:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ /index.php [L]
</IfModule>

请帮帮我。

【问题讨论】:

  • 当你不发布错误是什么时,很难帮助你。检查您的日志。
  • 检查您网站的 apache 日志。它会揭示奇迹。
  • 我的错误日志是空的。 @布拉德
  • 这是错误...'客户端被服务器配置拒绝:/home/bdtimesc/public_html/.htaccess'

标签: php .htaccess laravel-4


【解决方案1】:

首先确保您的 apache 配置文件中有 AllowOverride All 而不是 AllowOverride None。这是一个cpanel盒子吗?

还可以尝试将重写库添加到规则中。

RewriteBase /

像下面这样

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    RewriteBase /

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ /index.php [L]
</IfModule>

【讨论】:

  • 你把这个文件放在哪里?在公共文件夹中,例如在 Laravel 设置中,还是在 Laravel 应用程序的根文件夹中?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-10-25
  • 2015-08-12
  • 2015-01-05
  • 1970-01-01
  • 1970-01-01
  • 2014-08-05
  • 2013-01-13
相关资源
最近更新 更多