Apache Web服务器:AH00125:使用FallbackResource时请求超过了10个子请求的限制。

11

当我在我的Apache 2.4 Web服务器配置中使用“FallbackResource”时,它显示错误“AH00125:请求超过了10个子请求嵌套级别的限制”。

请帮忙解决一下。如果我指定url "http://localhost/bv-host/plusRoot/plus/fiets" 并且想将其转发到默认的index.html:“/bv-host/plusRoot/plus/index.html”

我已经启用了调试日志记录。 Mode-rewrite被禁用。如果我删除FallbackResource行,我不会看到这个错误,而是一个预期的404错误。

我在我的mac上进行了默认的2.4安装,并添加了以下配置:

FallbackResource /bv-host/plusRoot/plus/index.html;
Alias /bv-host/plusRoot "/Users/ed/Develop/Projecten/Web”

就是这样,调试日志代码片段:

[client ::1:57840] mod_hfs_apple: Allowing access with matching directory. filename = /Users/ed/Develop/Projecten/Web/plus/index.html;
AH00125: Request exceeded the limit of 10 subrequest nesting levels due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[client ::1:57840] AH00121: r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/index.html;
[client ::1:57840] AH00123: subrequested from r->uri = /bv-host/plusRoot/plus/fiets
3个回答

20

请注意,如果您的FallbackResource路径不是绝对路径,您也可能会遇到此错误。例如:

FallbackResource index.php

任何第二层级的请求都将失败:/foo/bar将失败,因为它会尝试回退到/foo/index.php。所以你需要指定根目录:

FallbackResource /index.php

我觉得这是针对所提出问题的正确解决方案。这样可以避免陷入循环。谢谢。 - b2vincent
这个解决方案真是救命稻草,完美地解决了问题。 - K997
我原本使用的是 ./index.html。更改为 /index.html 似乎解决了这个问题。 - Temba

5

我曾经在子文件夹中设置Silex应用程序时遇到类似的问题。我只是使用了FallbackResource index.php,但结果与您相同。

最终使用了传统的Rewrite示例。

RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

2

我也遇到了这个问题并找到了解决方法。

在我的情况下,这是因为页面请求了一个资源(一个css文件),但该资源没有放置在正确的目录中。

<link href="somewhere_bad_directory/font-awesome.min.css" rel="stylesheet" type="text/css">

然后FallbackResource被调用了十次,但没有提供资源,因此出现了错误。

解决方案:当在目录中使用“FallbackResource”时,如果出现“AH00125:请求超过10个子请求嵌套级别的限制”的错误,请仔细检查页面中是否有错位的资源。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接