Security: Deny access to .hg/* via mod_rewrite

后端 未结 3 699
予麋鹿
予麋鹿 2021-02-09 18:59

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

3条回答
  •  面向向阳花
    2021-02-09 19:35

    If you don't have to use mod_rewrite, then you can just do this:

    RedirectMatch 404 /\\.hg(/|$)
    

    (Full disclosure: answer adapted for Mercurial from this question about doing the same thing for Subversion).

提交回复
热议问题