【问题标题】:Laravel sends the server on 10 redirects?Laravel 在 10 次重定向上发送服务器?
【发布时间】:2013-05-28 22:31:30
【问题描述】:

收到错误信息:

[Sun Jun 02 12:43:33.579095 2013] [core:error] [pid 4964:tid 808] [client 127.0.0.1:56964] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a 

尝试使用 laravel 进行路由时。我的路线如下:

Route::get('/', 'HomeController@showWelcome');
Route::get('history', 'HistoryController@showHistory');

还有我的 .htaccess:

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On

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

还有我的别名:

Alias /wunhopkuendo/ "c:/wamp/www/wunhopkuendo/public/" 

<Directory "c:/wamp/www/wunhopkuendo/public/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>

【问题讨论】:

  • 当您没有定义路由时,是否也会发生这种情况?
  • 调整 LogLevel 以查看它在内部将您重定向到哪里。
  • 检查您的虚拟主机配置。公用文件夹的路径可能不是你想的那样。

标签: apache mod-rewrite laravel laravel-4


【解决方案1】:

我也遇到了这个问题,我通过 .htaccess 文件中的以下行解决了这个问题:

RewriteBase /

【讨论】:

    【解决方案2】:

    如果您在子文件夹中使用 Laravel,您需要按照以下步骤操作:

    假设您使用 WAMP 和默认安装目录(即c:\wamp

    在您的 .htaccess 文件中插入 RewriteBase 行以及您的 Laravel 安装的子文件夹。

    <IfModule mod_rewrite.c>
        Options -MultiViews
        RewriteEngine On
        RewriteBase /subfolder
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    <IfModule>
    

    在文件c:\wamp\www\subfolder\config\app.php上设置应用程序URL

    'url' => 'http://localhost/subfolder',
    

    在别名目录c:\wamp\alias\subfolder.conf 上创建一个配置文件,内容如下:

    Alias /subfolder "c:/wamp/www/testando/public"
    
    <Directory "c:/wamp/www/subfolder/public">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Allow from all
    </Directory>
    

    【讨论】:

    • 这是什么hggp
    【解决方案3】:

    检查您的公用文件夹是否设置正确

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-15
      • 2018-11-22
      • 2021-08-24
      • 1970-01-01
      • 2015-06-15
      • 2013-09-21
      • 2023-03-25
      • 2020-07-11
      相关资源
      最近更新 更多