由于可能的配置错误,请求超出了 10 个内部重定向的限制 [英] Request exceeded the limit of 10 internal redirects due to probable configuration error

查看:38
本文介绍了由于可能的配置错误,请求超出了 10 个内部重定向的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 CakePHP 应用程序出现以下错误:

I'm getting the following error in my CakePHP application:

由于可能的配置错误,请求超出了 10 个内部重定向的限制.如有必要,请使用LimitInternalRecursion"来增加限制.使用LogLevel debug"获取回溯.,引用:http://projectname.dev/

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 backtrace., referer: http://projectname.dev/

我在根文件夹中的 .htaccess 如下所示:

My .htaccess in the root folder, looks like this:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

并在应用程序文件夹中:

and in the app folder:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

在 webroot 文件夹中:

and in the webroot folder:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /projectname
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

我正在学习本教程:

http://book.cakephp.org/2.0/en/getting-开始.html

推荐答案

我刚刚在这里找到了解决问题的方法:

I just found a solution to the problem here:

https://willcodeforcoffee.com/cakephp/2007/01/31/cakephp-error-500-too-many-redirects.html

webroot 中的 .htaccess 文件应如下所示:

The .htaccess file in webroot should look like:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

而不是这个:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /projectname
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

这篇关于由于可能的配置错误,请求超出了 10 个内部重定向的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆