rewriting to an empty file so I don't log myself. (Apart from the content of the htaccess, the local files are intended to be an exact replica of the real thing, so simply moving the logheaders.php file isn't an option. Besides, I'd then get spurious error logs instead.)
Turns out this works most of the time, but visits to certain directories still get logged, meaning that the rewrite isn't taking place, meaning in turn that the request is somehow not getting seen by htaccess.
:: skipping over detailed description of steps involved in investigation ::
Turns out the variable is how the logheaders.php file gets included in the first place. If it's in the form
It would seem that SSI includes are treated as an internal sub-request, and therefore subject to rewrite rules. PHP includes, on the other hand, are not. So I suppose that if you absolutely must rely on rewrite rules to alter the included file, then you have to stick to SSI.