Hide .git repo with Apache
Snippet
Posted by kitt at 13:11 on 14 August 2018
Solution 2.
Don't allow apache to serve anything from the .git
repo that might be in the DocumentRoot
. This is great because it hides that there even IS a git repo on the webserver.
Add this to the .htaccess in the DocumentRoot
after the RewriteEngine On
line.
RedirectMatch 404 /\.git
Add new comment