I notice that a lot mod_rewrite rules are based on the value in HTTP_REFERER but can this be trusted? Don't most browsers have a Privacy mode now that leaves HTTP_REFERER empty? And can't an attacker easily modify HTTP_REFERER?
It seems that legitimate users browsing privately would get blocked if the rule was looking for something special in HTTP_REFERER, and illegitimate users could put whatever you're looking for in there.