Rewrite problem i don't get it

Hi all.

I’ve read most of the articles and the redirect is functioning but not really like it should.

here’s what i have.



ErrorDocument 404 /index.php?special=404

RewriteEngine on
RewriteRule ^English/(.*) rewrite.php?ff=$1


Now if i go to http://site.com/whatever

the redirect shouldn’t work… it should only work if i go to
http://site.com/English/whatever

but everything seems to be redirecting to rewrite.php even files like flavicon.ico

what am i missing?

Peanuts

Add

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

To your rules - this will stoip the progression for any REAL file, allowing direct access to them.

Tim,

peanuts is correct (so there must be something else in his .htaccess he’s not showing us). Not file and not directory have nothing to do with the regex he’s showing.

Regards,

DK

I was tryin to cover the favicon redirect rather than the first bit which does need to know a little more about.

Tim,

Oh, my! You’ve just pointed out that I’ve missed an opportunity to use my Standard Rant #1!

[rant #1][indent]The use of “lazy regex,” specifically the :kaioken: EVERYTHING :kaioken: atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is “greedy.” Unless you provide an “exit” from your redirection, you will ALWAYS end up in a loop![/indent][/rant #1]

Oh, well, it wasn’t really appropriate because the (.*) was hidden in the English subdirectory and the redirection was NOT to that same subdirectory (which avoided the common LOOP problem). True, everything within that subdirectory would be redirected but that’s another problem (which peanuts must eventually learn).

Regards,

DK