Security: Deny access to .hg/* via mod_rewrite

后端 未结 3 683
予麋鹿
予麋鹿 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:27

    This is much less of a concern if you just keep the repositories outside of your DocumentRoot altogether. You're probably using hgweb or hgwebdir, which don't require the files be inside the DocumentRoot, so don't do it. Put them in /home/hg/repos or something and configure your hgwebdir.conf to look there.

    The only reason to have the repos inside the DocumentRoot would be enable the static-http URL form for mercurial, but it's very slow and hgweb is always preferred when it's possible.

提交回复
热议问题