Skip to content

Instantly share code, notes, and snippets.

@Nolwennig
Last active January 21, 2016 13:03
Show Gist options
  • Save Nolwennig/54f8dc223ae3ef3f24a8 to your computer and use it in GitHub Desktop.
Save Nolwennig/54f8dc223ae3ef3f24a8 to your computer and use it in GitHub Desktop.
protection git htaccess
# source: https://marceau.casals.fr/blog/2015/05/le-htaccess-ce-heros
RedirectMatch 404 ^/(app|config|system|\.hg|\.idea|\.git|logs).*$
RedirectMatch 404 \.(md|json|yaml|gitignore|rev|neon)$
# source: http://serverfault.com/a/527911/329412 // more light but not tested
RedirectMatch 404 /\.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment