问题描述
我收到以下错误在我的CakePHP应用程序:
I'm getting the following error in my CakePHP application:
请求超过了10内部重定向的限制,由于可能的配置错误。使用LimitInternalRecursion如有必要,以提高额度。使用LogLevel的调试'以取得一个回溯,引用者:
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>
和在应用程序文件夹:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
和在Web根目录文件夹:
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>
我下面这个教程:
I was following this tutorial:
http://book.cakephp.org/2.0/en/getting-started.html
问候,
斯蒂芬
Regards,Stephen
推荐答案
我刚刚发现这里的问题的解决方案:
I just found a solution to the problem here:
<一个href=\"http://will$c$cforcoffee.com/2007/01/31/cakephp-error-500-too-many-redirects/\">http://will$c$cforcoffee.com/2007/01/31/cakephp-error-500-too-many-redirects/
在根目录的.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内部重定向的限制,由于可能的配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!