Linux

請求超出了 10 個內部重定向的限制

  • October 5, 2013

所以這是錯誤

[Mon Sep 30 00:09:53 2013] [error] [client 66.249.66.205] 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.
[Mon Sep 30 00:09:53 2013] [debug] core.c(3120): [client 66.249.66.205] r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /home/mysitecom/domains/mysite.com/public_html/index.php
[Mon Sep 30 00:09:53 2013] [debug] core.c(3126): [client 66.249.66.205] redirected from r->uri = /images/2013/02/600x376_0.076827001313237200_pixnaz_ir_1.jpg

我怎麼能找到這是什麼原因?

它似乎是一個圍繞 index.php 的循環,除了最後一個是圖像之外,很可能連結在我的一個頁面中(不是索引)

我正在使用 codeigniter,它是一個 mvc 框架,一切都通過 index.php 文件進行……所以很難理解哪裡出錯了。

顯然它與htaccess有關(在幾個部落格中提到過)

這是我的 htacc …基本上它從所有連結中刪除了 index.php ,沒有什麼不尋常的

<IfModule mod_rewrite.c>
   RewriteEngine On

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
   # If we don't have mod_rewrite installed, all 404's
   # can be sent to index.php, and everything works as normal.
   # Submitted by: ElliotHaughin

   ErrorDocument 404 index.php
</IfModule> 
AddType image/x-windows-bmp bmp

我有一個專用伺服器

您需要添加一個異常,這樣您就不會重寫index.phpindex.php?/index.php. (另外,你確定你想要一個/之後?嗎?)

這是一個 RewriteCond 來停止該循環:

RewriteCond %{REQUEST_URI} != /index.php/

它應該插入到 RewriteRule 之前。

循環的原因是每次在 .htaccess 文件中觸發重寫時,apache 都會創建一個內部子請求。這是應避免在 .htaccess 中重寫的眾多原因之一。因此,如果您確實有權訪問您的 httpd.conf,請將重寫內容放在那裡。如果你不能把你的重寫放在配置中,如果你真的必須使用 .htaccess 文件,那麼請確保添加一個打破循環的條件。

引用自:https://serverfault.com/questions/543266