I've got a nasty suspicion that
(a) this is not really an apache question but a php question
(b) if someone else asked the identical question, I'd see the answer in an instant.
In the .htaccess file that goes with the pseudo-server on my HD, I've got a couple of RewriteRules to bypass the analytics and logging that happen on the live sites. Things like
RewriteRule logheaders /boilerplate/locallogs.php [L]
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
<!--#include virtual="/boilerplate/logheaders.php" -->
all is well. If, instead, it's in the form
include ($_SERVER['DOCUMENT_ROOT'] . "/boilerplate/logheaders.php");
the rewrite does not take place.
What gives? How does php contrive to get hold of a file without Apache noticing? And, probably more important: Is this an artifact of MAMP, or would exactly the same thing happen on the live site?