Re: Apache: Request exceeded the limit of 10 internal redirects

From: Date: Thu, 27 Jan 2005 12:13:38 +0000
Subject: Re: Apache: Request exceeded the limit of 10 internal redirects
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-207466@lists.php.net to get a copy of this message
Marek Kilimajer wrote: ...
I know its due to the way my Apache is setup (not rewrite rules) but the following always works for me: http://www.somedomain.com/doit runs http://www.somedomain.com/doit.php -- apache just does its magic - I believe its to do with the DocumentIndex apache conf setting (i.e. Apache makes use of the extensions found there) - please someone correct me if I'm wrong.
heh Marek, I wasn't the original poster on this thread - I don't have any problems with my setup - I was just mentioning the behaviour of my server.... which does make use of some rewrite rules - but (AFAIKS) not for the behaviour I described.
Your conditions are as follows: 1. reqeusted filename is not a directory:
    RewriteCond %{REQUEST_FILENAME} !-d
2. reqeusted filename is not a file:
    RewriteCond %{REQUEST_FILENAME} !-f
If all above matches, put ".php" at the end:
    RewriteRule ^(.*)$ /$1.php
So it has nothing to do with DocumentIndex. All that is necessary is to request a file that does not exist on the server even if you add ".php" at the end: /foo - neither file or directory, rewrite to /foo.php /foo.php - neither file or directory, rewrite to /foo.php.php /foo.php.php - neither file or directory, rewrite to /foo.php.php.php ...etc. The problem is ^(.*)$ matches everything. Try ^([^.]*)$ - no dot in url
as I said I don't have a problem.... but your point is well made is relation to the originally posted problem :-)


« previous php.general (#207466) next »