解决Use 'LimitInternalRecursion' to increase the limit if necessary的问题 CodeIgniter .htaccess

配置.htaccess如下:

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images|robots\.txt|css|js); 
RewriteRule ^(.*)$ /sis/index.php/$1 [L]

Apache(error.log)报错如下:

12220:tid 1848] [client ::1:50815] 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 backtrace.
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3590): [client ::1:50815] AH00121: r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/sis/index.php/news/create
[Thu Sep 10 14:24:14.491172 2015] [core:debug] [pid 12220:tid 1848] core.c(3596): [client ::1:50815] AH00122: redirected from r->uri = /sis/index.php/news/create

搜集到的有用的参考资料:http://www.askapache.com/htaccess/modrewrite-tips-tricks.html

Loop Stopping Code ^

Sometimes your rewrites cause infinite loops, stop it with one of these rewrite code snippets.

RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|error/).* [NC]
RewriteRule .* - [L]

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

修改后的.htaccess

RewriteEngine on
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
RewriteCond $1 !^(index\.php|images|robots\.txt|css|js); 
RewriteRule ^(.*)$ /sis/index.php/$1 [L]

问题解决:浏览器地址栏中输入http://localhost/sis/news(不用输入index.php),页面打开正常。

转载于:https://www.cnblogs.com/sinodragon21/p/4797863.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值