Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache: Request exceeded the limit of 10 internal redirects

Status
Not open for further replies.

cadbilbao

Programmer
Apr 9, 2001
233
ES
Hi

I've just installed Apache 2.0.52, with:

./configure --prefix=/usr/local/httpd --enable-so --enable-modules=all

My httpd.conf includes:
-----------------------------------
<VirtualHost mydomain>
ServerAdmin f...@mydomain
DocumentRoot "/home/mydomain"
ServerName mydomain
ErrorLog logs/mydomain-error_log
CustomLog logs/mydomain-access_log common
DirectoryIndex index.php index.html index.html.var
<Directory "/home/mydomain">
php_flag allow_url_fopen 1
php_flag magic_quotes_gpc 0
RewriteEngine on
RewriteOptions MaxRedirects=15
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /$1.php
</Directory>
</VirtualHost>
---------------------------------
(I try to make Apache serve 'foo' as 'foo.php')

But when accessing ' I get no webpage,
but this error log:
----------------------------------
[Mon Jan 24 10:47:59 2005] [debug] mod_rewrite.c(1778): [client
192.168.2.101] mod_rewrite's internal redirect status: 10/15.
[Mon Jan 24 10:47:59 2005] [error] [client 192.168.2.101] 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.
[Mon Jan 24 10:47:59 2005] [debug] core.c(2748): [client 192.168.2.101]
r->uri = /favicon.ico.php.php.php.php.php.php.php.php.php.php
[Mon Jan 24 10:47:59 2005] [debug] core.c(2754): [client 192.168.2.101]
redirected from r->uri =
/favicon.ico.php.php.php.php.php.php.php.php.php
[Mon Jan 24 10:47:59 2005] [debug] core.c(2754): [client 192.168.2.101]
redirected from r->uri = /favicon.ico.php.php.php.php.php.php.php.php
[Mon Jan 24 10:47:59 2005] [debug] core.c(2754): [client 192.168.2.101]
redirected from r->uri = /favicon.ico.php.php.php.php.php.php.php
--------------------------------

If I remove the line 'RewriteOptions MaxRedirects=15', I get
a very similar error:
----------------------------
[Wed Jan 24 10:31:29 2005] [debug] mod_rewrite.c(1778): [client 192.168.2.101] mod_rewrite's internal redirect status: 10/10.
[Wed Jan 24 10:31:29 2005] [error] [client 192.168.2.101] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
[Wed Jan 24 10:31:29 2005] [debug] mod_rewrite.c(1778): [client 192.168.2.101] mod_rewrite's internal redirect status: 0/10.
-------------------------------

What am I doing wrong? Thank you very much.
 
cadbilbao,

It looks like you have a bug in your RewriteRule.

Code:
[Mon Jan 24 10:47:59 2005] [debug] core.c(2748): [client 192.168.2.101]r->uri = /favicon.ico.php.php.php.php.php.php.php.php.php.php

Seems to indicate that mod_rewite is adding .php over and over when the RewriteCond is met.

See and

Wishdiak
A+, Network+, MCSA 2003 certified
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top