Forum Moderators: phranque
Mine is already 22Kb due to many 301 redirects. I want to block access of certain countries (because their inhabitants are constantly using stolen credit card numbers on my site) and that would put my .htaccess file way over the limit.
Does anybody have a way out of this jam?
I've peaked out at well over 100kB before (during a scraper storm) with no ill effects except a slight slow-down serving pages/resources.
Jim
The file's a whopper because it's chock-full of commented-out lines/notes to myself, like this snippet courtesy of a 2005 Jim Morgan post:) --
## BLOCK *Faked* blank referer -OR- UA (malicious agents supply a literal hyphen as UA string)
## either the referrer or the user-agent to be a literal "-", which is a rare but nasty exploit
## [webmasterworld.com...]
RewriteCond [from that post; etc.]
-- so actual commands probably weigh in at ~200k, give or take.
Entries are in sections so the server doesn't have to process the entire file for every single hit. (Higher-level RewriteLogs are eye-poppers!)
For example, I have a BANNED UAs section with loads of [NC,OR] conditions ending in a single [F,L] rule. Other sections include BANNED IPs, BANNED HOSTs; there are even monthly sections where I keep an eye on new, iffy visitors (...if I have time to get really, really obsessive:)
The sectional scheme is also a plus because if I goof up one section's code, I don't lose ALL protections.
FWIW