Forum Moderators: phranque

Message Too Old, No Replies

RewriteOptions inherit order of processing

Order in which rewrite rules are processed in virtual hosts

         

DJJoe

9:20 am on Oct 26, 2004 (gmt 0)



Having read extensively here about banning bad bots, I decided to add config to do this to my httpd.conf file. (What prompted me was a nasty hit from HTTrack) Since I run a few virtual hosts, I wanted to define the rules once and inherit this configuration for all vurtual hosts. After searching for quite a while, I found the directive I wanted - RewriteOptions inherit.

It works fairly well. However, the inherited rules are processed after the virutal-host specific ones. That seems logical in many ways, since the newer ones should probably take precedence. Except in this case, the bad bot banning is general and doesn't need to be "over-ruled".

So, you can guess what happens if you have a RewriteRule with [something,L] defined in a virtual host - that's the last rule to get processed, and the nicely written inherited ones get skipped.

Any ideas? Am I missing something trivial? Is there a way to order the inheritance, or must I remove all the L flags in the virtual-host rules, and re-check that they all still work...?

jdMorgan

8:58 pm on Oct 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



DJJoe,

Welcome to WebmasterWorld!

I don't have an definitive answer for you, but we now have a possibly-related discussion [webmasterworld.com] going which might be useful to you.

Jim

bose

3:38 pm on Oct 28, 2004 (gmt 0)

10+ Year Member



Welcome to WebMasterWorld, DJJoe.

Interesting question, indeed. I don't know if it is even possible to make inherited rules take precedence over the virtualhost specific stuff.

<rambling>
What if you were to incorporate that "Bad bot stuff" in "Section 2: 'Main' server configuration" of your httpd.conf? Would that not help?
</rambling>