Request exceeded the limit of 10 internal redirects

前端 未结 7 654
暗喜
暗喜 2020-11-29 07:08

My website has been slowed down a little last couple of days. I\'ve looked into my error log and found lots of these:

[Mon Sep 30 00:09:53 2013] [error] [c         


        
7条回答
  •  迷失自我
    2020-11-29 07:29

    To prevent infinite looping add an extra RewriteCond line on top of your rule like this:

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
    

    RewriteCond %{ENV:REDIRECT_STATUS} ^$ prevents looping by checking an internal mod_rewrite variable REDIRECT_STATUS which is set to 200 after first successful internal redirect.

    Reference: Apache mod_rewrite Introduction

提交回复
热议问题