Request Exceeded the Limit of 10 Internal Redirects

Request exceeded the limit of 10 internal redirects

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

Request exceeded the limit of 10 internal redirects due to probable configuration error

I just found a solution to the problem here:

https://willcodeforcoffee.com/cakephp/2007/01/31/cakephp-error-500-too-many-redirects.html

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>

instead of this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projectname
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

Request exceeded the limit of 10 internal redirects - .htaccess

You need to exclude the destination you are rewriting to :

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /apply/
RewriteRule ^$ webroot/ [L]
RewriteCond %{REQUEST_URI} !^/webroot/
RewriteRule (.*) webroot/$1 [L]
</IfModule>

Otherwise you will get a rewrite loop error, because /webroot/ also matches the pattern (.*)

Request exceeded the limit of 10 internal redirects due to probable configuration

Try these rules with end anchors:

Options -MultiViews
RewriteEngine On
RewriteBase /

RewriteRule ^main/?$ index.php [L]
RewriteRule ^login/?$ login.php [L]
RewriteRule ^logout/?$ logout.php [L]
RewriteRule ^tags/?$ tags.php [L]

RewriteRule ^audios/([^/]+)/?$ audios.php?type=$1 [L,QSA]
RewriteRule ^audios/([^/]+)/page([^/]*)$ audios.php?type=$1&page=$2 [L,QSA]
RewriteRule ^audios/([^/]+)/([^/]*)$ audios.php?type=$1×ort=$2 [L,QSA]
RewriteRule ^audios/([^/]+)/([^/]+)/page([^/]*)$ audios.php?type=$1×ort=$2&page=$3 [L,QSA]

Request exceeded the limit of 10 internal redirects due to probable configuration error

RewriteCond is only applicable to very next RewriteRule and not for all the RewriteRule in your .htaccess. That said you have many do-nothing rules that should also be removed. Also rather than %{QUERY_STRING} you can use QSA flag.

Try this in your site root .htaccess:

RewriteEngine on

# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

RewriteRule ^info\.php$ util.php?um=info [L,QSA]

RewriteRule ^ux/([^/]*)/([^/]*)/(.*)$ util.php?um=$1&mode=$2&$3 [L,QSA]

RewriteRule ^ux/([^/]+)/(.*)$ util.php?um=$1&$2 [L,QSA]

RewriteRule ^ux/(.*)$ util.php?um=$1 [L,QSA]

RewriteRule ^([^/]+)/([^/.]+)\.html$ index.php?md=$1&ref=$2 [L,QSA]

RewriteRule ^(.+)\.html$ index.php?md=page&ref=$1 [L,QSA]

RewriteRule ^([^/]+)/?$ index.php?md=page&ref=$1 [L,QSA]

RewriteRule ^rss/events util.php?um=rss&ref=Events&_m=EVNT [L,QSA]

RewriteRule ^u/([^/]+)/?$ index.php?md=url&ref=$1 [L,QSA]


Related Topics



Leave a reply



Submit