Overlapping Bill: RewriteRule /.*_12345\.xx$ http:www.some-site.com/123456 [R=301,NE,L]
How efficient would mod_rewrite be in dealing with 30.000 lines like this?
Oh. Ouch. Oh. Ouch. Ow, ow, ow. If you mean the "like this" part literally, tell your established users to send you their orders by carrier pigeon. They'll reach you faster.
It's this bit:
/.*_12345\.xx$
Every single time mod_rewrite reaches this Rule-- or any of its 30,000 siblings-- it will have to go through the following:
/.*_12345\.xx$
gobblegobblegobble to the very end
Oh. Oops! I'm supposed to look for a lowline.
Backtrack, look for _, backtrack further, look for _, backtrack...
OK, here's a lowline. Now to see if it's followed by "12345.xx".
The only good news is that the lowline you want is the last one-- potentially-- in the request. Otherwise there would be still more backtracking and re-evaluating.
Instead you proceed to the redirect, including "noescape" flag even though nothing in the URL would call for escaping anyway. You don't have query strings do you? Not much point in redirecting to an extensionless URL-- and then keeping a clunky long query at the end of it all.
Now, does the .xx represent some specific extension? At a minimum, it's got to be a page, like .html or .php. So any requests for images or stylesheets or scripts have to read the rule right along with everything else-- unless you can deflect them right at the beginning.
if there is a rule on line 100 or so in the config that matches 99% of all requests
Is that 99% of all
page requests, or just 99% of all requests everywhere?
In any case, there is no flag that says "The remainder of this file is devoted exclusively to mod_rewrite, so the rest of youse can pack up and go home". All the other mods still have to plow through the whole 30,000 lines on the off chance that Line 14,592 contains a mod_alias directive or Line 28,824 has a rule for mod_setenvif.
Grab all requests of all kinds that will
not require special handling and stick an [L] flag on them. The rest get rewritten to a php script that will do its stuff without bothering anyone else.