Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save name-k/8080373 to your computer and use it in GitHub Desktop.
Save name-k/8080373 to your computer and use it in GitHub Desktop.
Block Access to Hidden Files and Directories We try to push our code to productions servers without hidden files and directors, like our revision system directors, but that doesn't always happen. This snippet prevents those files from being accessible:
<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment