You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Johnson <ti...@johnsons-web.com> on 2010/11/11 01:31:11 UTC

[users@httpd] internal redirects error

I'm using apache2 on ubuntu 10.04.
I am a programmer familiar with the command line, but
new to fine-tuning apache.

I'm getting following error message:
"""
Request exceeded the limit of 10 internal redirects due to probable
configuration error. Use 'LimitInternalRecursion' to increase the
limit if necessary
"""
This is caused by the follow directive (I believe)
    <Directory "/home/http/py">
        <IfModule mod_dir.c>
            DirectoryIndex pyindex.py
        </IfModule>
        AllowOverride all
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
The intent is that for directory /home/http/py the default 'page' 
would be pyindex.py. And I want to restrict pyindex.py as
only the default page for that particular directory.

So what is the configuration error?
thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] internal redirects error

Posted by Tim Johnson <ti...@johnsons-web.com>.
* Igor Cicimov <ic...@gmail.com> [101110 16:55]:
> Your RewriteRule doesn't make much sense though. It will cause to redirect
> http://localhost/reg to pyindex.py/reg (plus append the query string if any)
> and I don't see the purpose of this redirect. What are you really trying to
> achieve here?
> 
> If the idea is to redirect virtual links, the one without real files in the
> apache file system, then you better do
> 
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ /py/ <http://pyindex.py/$1> [L]
> 
> which will redirect any non existing link to the pyindex.py file which is
> your home page I assume.
  Thank you Igor. The changes that you recommend above for .htaccess
  have been implemented. I believe that I have solved my problem.
  best of luck. Keep up the great help.
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] internal redirects error

Posted by Igor Cicimov <ic...@gmail.com>.
Your RewriteRule doesn't make much sense though. It will cause to redirect
http://localhost/reg to pyindex.py/reg (plus append the query string if any)
and I don't see the purpose of this redirect. What are you really trying to
achieve here?

If the idea is to redirect virtual links, the one without real files in the
apache file system, then you better do

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /py/ <http://pyindex.py/$1> [L]

which will redirect any non existing link to the pyindex.py file which is
your home page I assume.

Igor

On Thu, Nov 11, 2010 at 11:54 AM, Tim Johnson <ti...@johnsons-web.com> wrote:

> * Igor Cicimov <ic...@gmail.com> [101110 15:41]:
> > "AllowOverride all" so maybe some redirection in .htaccess file in that
> > directory causing infinite loop?
> >
> > Try setting it to None instead and see if the problem goes away. Then
> you'll
> > know the problem is in the .htaccess file for sure.
>   Yes, that solves that problem, but creates another: now a
>  ScriptAlias directive fails.
>  So now I have the following in total:
>    ScriptAlias /reg/ /home/http/py/
>     <Directory "/home/http/py">
>        <IfModule mod_dir.c>
>            DirectoryIndex pyindex.py
>        </IfModule>
>        #AllowOverride all
>         ## Scriptalias will not work with AllowOverride set to 'None'
>        AllowOverride None
>         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>        Order allow,deny
>        Allow from all
>    </Directory>
>   Now if I point the browser to http://localhost/py, pyindex.py executes,
>  but if I point the browser to http://localhost/reg I get
> "You don't have permission to access /reg/ on this server."
> .htaccess is as follows:
> # begin
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ ./pyindex.py/$1 [L,QSA]
> # end
>
>  *However* I really don't need the ScriptAlias. But this is a learning
>  experience for me.
>  Thank you.
>
> --
> Tim
> tim at johnsons-web.com or akwebsoft.com
> http://www.akwebsoft.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] internal redirects error

Posted by Tim Johnson <ti...@johnsons-web.com>.
* Igor Cicimov <ic...@gmail.com> [101110 15:41]:
> "AllowOverride all" so maybe some redirection in .htaccess file in that
> directory causing infinite loop?
> 
> Try setting it to None instead and see if the problem goes away. Then you'll
> know the problem is in the .htaccess file for sure.
  Yes, that solves that problem, but creates another: now a
  ScriptAlias directive fails. 
  So now I have the following in total:
    ScriptAlias /reg/ /home/http/py/
    <Directory "/home/http/py">
        <IfModule mod_dir.c>
            DirectoryIndex pyindex.py
        </IfModule>
        #AllowOverride all
        ## Scriptalias will not work with AllowOverride set to 'None'
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
  Now if I point the browser to http://localhost/py, pyindex.py executes,
  but if I point the browser to http://localhost/reg I get
"You don't have permission to access /reg/ on this server."
.htaccess is as follows:
# begin
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ ./pyindex.py/$1 [L,QSA]
# end

  *However* I really don't need the ScriptAlias. But this is a learning
  experience for me.
  Thank you. 

-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] internal redirects error

Posted by Igor Cicimov <ic...@gmail.com>.
"AllowOverride all" so maybe some redirection in .htaccess file in that
directory causing infinite loop?

Try setting it to None instead and see if the problem goes away. Then you'll
know the problem is in the .htaccess file for sure.

Igor

On Thu, Nov 11, 2010 at 11:31 AM, Tim Johnson <ti...@johnsons-web.com> wrote:

> I'm using apache2 on ubuntu 10.04.
> I am a programmer familiar with the command line, but
> new to fine-tuning apache.
>
> I'm getting following error message:
> """
> Request exceeded the limit of 10 internal redirects due to probable
> configuration error. Use 'LimitInternalRecursion' to increase the
> limit if necessary
> """
> This is caused by the follow directive (I believe)
>    <Directory "/home/http/py">
>        <IfModule mod_dir.c>
>            DirectoryIndex pyindex.py
>        </IfModule>
>        AllowOverride all
>        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>        Order allow,deny
>        Allow from all
>    </Directory>
> The intent is that for directory /home/http/py the default 'page'
> would be pyindex.py. And I want to restrict pyindex.py as
> only the default page for that particular directory.
>
> So what is the configuration error?
> thanks
> --
> Tim
> tim at johnsons-web.com or akwebsoft.com
> http://www.akwebsoft.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>