Huh. Mine's a more comprehensive
BrowserMatch ^\W bad_agent
(initial non-word character). "BrowserMatch" is a useful setenvif shortcut, identical to "SetEnvIf User-Agent".
The quotation marks and the escape are both unnecessary. In mod_setenvif, the only time you really need quotation marks is to "protect" a literal space in the string you're evaluating. The = sign isn't a reserved character in RegEx-in-general; it's only got syntactic meaning in a few specific Apache contexts, and this isn't one of them. (Not sure, but the quotation marks here
may even mean that \= is interpreted as literal backslash.)
Is it really lower-case "mozilla"? Yuk.
:: detour to check recent logs ::
Huh. I know I've seen this configuration--with leading = sign--but they don't seem to have been around lately. What I do see a scattered handful of is
--user-agent=Mozilla/5.0 etcetera
or
User-Agent=Mozilla etcetera
where the latter is another pattern I formerly blocked ("formerly" because it's obviously a hallmark of an exceptionally stupid robot, meaning they'll never get through the gate anyway so why bother making the server check at all).