Answer the question
In order to leave comments, you need to log in
Why does htaccess give Request exceeded the limit of 10 internal redirects due to probable configuration error?
The situation is this:
I have a site on yii2. There is a subfolder frontend/web to which you need to set up a redirect from the site root.
.htaccess in site root:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Enable mod_rewrite
RewriteEngine On
RewriteBase /
# Frontend redirect
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule ^(.*)$ frontend/web/$1
</IfModule>
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc81d28/initial] (3) [perdir /home/fragme/devs/9015/www/fragme/] strip per-dir prefix: /home/fragme/devs/9015/www/fragme/ ->
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc81d28/initial] (3) [perdir /home/fragme/devs/9015/www/fragme/] applying pattern '^(.*)$' to uri ''
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc81d28/initial] (2) [perdir /home/fragme/devs/9015/www/fragme/] rewrite '' -> 'frontweb/web/'
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc81d28/initial] (3) [perdir /home/fragme/devs/9015/www/fragme/] add per-dir prefix: frontweb/web/ -> /home/fragme/devs/9015/www/fragme/frontweb/web/
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc81d28/initial] (2) [perdir /home/fragme/devs/9015/www/fragme/] trying to replace prefix /home/fragme/devs/9015/www/fragme/ with /
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc81d28/initial] (1) [perdir /home/fragme/devs/9015/www/fragme/] internal redirect with /frontweb/web/ [INTERNAL REDIRECT]
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (3) [perdir /home/fragme/devs/9015/www/fragme/] add path info postfix: /home/fragme/devs/9015/www/fragme/frontweb -> /home/fragme/devs/9015/www/fragme/frontweb/web/
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (3) [perdir /home/fragme/devs/9015/www/fragme/] strip per-dir prefix: /home/fragme/devs/9015/www/fragme/frontweb/web/ -> frontweb/web/
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (3) [perdir /home/fragme/devs/9015/www/fragme/] applying pattern '^(.*)$' to uri 'frontweb/web/'
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (2) [perdir /home/fragme/devs/9015/www/fragme/] rewrite 'frontweb/web/' -> 'frontweb/web/frontweb/web/'
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (3) [perdir /home/fragme/devs/9015/www/fragme/] add per-dir prefix: frontweb/web/frontweb/web/ -> /home/fragme/devs/9015/www/fragme/frontweb/web/frontweb/web/
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (2) [perdir /home/fragme/devs/9015/www/fragme/] trying to replace prefix /home/fragme/devs/9015/www/fragme/ with /
212.224.112.72 - - [17/Nov/2014:13:44:26 +0300] [9015.devs.fragme.org/sid#7f065b92f688][rid#7f065bc86290/initial/redir#1] (1) [perdir /home/fragme/devs/9015/www/fragme/] internal redirect with /frontweb/web/frontweb/web/ [INTERNAL REDIRECT]
Answer the question
In order to leave comments, you need to log in
The problem turned out to be in htaccess, which was located in /frontend/web
It was necessary to add
RewriteBase /
Well, the error says "limit of 10 internal redirects reached" - the logs show that Apache endlessly adds 'frontweb/web/' -> 'frontweb/web/frontweb/web/' to your path. Since you need to redirect all requests, remove the RewriteCond %{REQUEST_URI} ^(.*)$ line altogether.
Or make it not return true when the internal redirect has already happened
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question