I wrote .htaccess in file dir/subdir to don't log URI requests in this particular directory. The .htaccess is actually executed by apache (if i write deny from , it works), but if the file contains only this rule:

   SetEnvIf Request_URI "^dir/subdir" dontlog

Don't work. AllowOverride All and mod_rewrite are enabled. What can be the problem?

Sorry for my bad english.

1 Answer 1


You should have this in your htaccess :

SetEnvIf Request_URI "^/dir/subdir(.*)$" dontlog

And something like this is you apache config :

CustomLog /var/log/apache2/access.log combined env=!dontlog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.