Skip to content

Instantly share code, notes, and snippets.

@explorador
Last active August 29, 2022 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save explorador/e316fbd640a8777578ae6fee8ecc4ab3 to your computer and use it in GitHub Desktop.
Save explorador/e316fbd640a8777578ae6fee8ecc4ab3 to your computer and use it in GitHub Desktop.
# -------------------------------------------------
# Protect your .git directory!
# (You don't want anyone to download a copy of your website)
# -------------------------------------------------
# Add to .htaccess
# For Apache 2.4
<DirectoryMatch "^/.*/\.git/">
Require all denied
</DirectoryMatch>
# For Apache 2.2
<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