Re: Apache: Request exceeded the limit of 10 internal redirects
| From: | Richard Lynch | Date: | Wed, 26 Jan 2005 21:03:17 +0000 |
| Subject: | Re: Apache: Request exceeded the limit of 10 internal redirects | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207422@lists.php.net to get a copy of this message | ||
James Guarriman wrote:
> RewriteEngine on
> RewriteOptions MaxRedirects=15
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ /$1.php
> </Directory>
> </VirtualHost>
Despite the very very very scary warnings not to, turn on the Rewrite
Logging feature and tail -f the log until you figure this out.
Otherwise, you will be banging your head against a black box, with NO IDEA
why it does what it does (other than hurt). :-)
Just remember to turn it OFF when you are on a Production site, or you'll
regret it quickly.
What you probably want is to only match things that don't already have a
'.' in them -- If they ask for foo.jpg, and it's not there, you don't want
foo.jpg.php instead, right?
That's what you tried to do with this:
> RewriteRule ^(.*)$ /$1.php
You probably wanted more like:
RewriteRule ([^\.]) /$1.php
That probably ain't right, but your goal is to get only filenames with NO
'.' in them, and you need \ to esacpe the . so it doesn't mean "any
character"
--
Like Music?
http://l-i-e.com/artists.htm