My website is a mercurial repository with multiple subrepositories. I need to make sure I\'m denying access to all files in every .hg directory on the server.
For exampl
If you don't have to use mod_rewrite, then you can just do this:
mod_rewrite
RedirectMatch 404 /\\.hg(/|$)
(Full disclosure: answer adapted for Mercurial from this question about doing the same thing for Subversion).