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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux