-
Notifications
You must be signed in to change notification settings - Fork 0
Apache
Dr. Thomas Jansen edited this page Dec 11, 2023
·
9 revisions
If you are using the Apache HTTP server, add the following DirectoryMatch
directive to your global httpd.conf
file:
<DirectoryMatch "/\.git">
Require all denied
</DirectoryMatch>
<DirectoryMatch "/\.git">
Deny from all
</DirectoryMatch>
Note
Don't forget to restart Apache after making the change, e.g. on Debian:
sudo systemctl restart apache2
If you are using the Apache HTTP server on a shared host, add the following directives to you local .htaccess
file:
RewriteEngine On
RewriteRule ^\.git - [F]