Skip to content

Instantly share code, notes, and snippets.

@polds
Created November 12, 2013 16:28
Show Gist options
  • Save polds/7434000 to your computer and use it in GitHub Desktop.
Save polds/7434000 to your computer and use it in GitHub Desktop.
Apache configuration to block access to .git folders.
#
# Add this somewhere in your httpd.conf file.
# I recommend you put it near the same
# place that your .htaccess access
# exclusions are configured.
#
<Directorymatch "^/.*/\.git/">
Order deny,allow
Deny from all
</Directorymatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment