Skip to content

Instantly share code, notes, and snippets.

@mjau-mjau
Last active May 30, 2017 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjau-mjau/bc473382584bf2f8a53c033bb676d7b1 to your computer and use it in GitHub Desktop.
Save mjau-mjau/bc473382584bf2f8a53c033bb676d7b1 to your computer and use it in GitHub Desktop.
Apache deny access to directory
# Deny access to all files in folder
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
@mjau-mjau
Copy link
Author

Drop this .htaccess file into any directory where all file access should be blocked. This is the default .htaccess file used in X3 for protecting the /config and /_cache directories.

Detecting <IfModule mod_authz_core.c> allows us to apply rule depending on Apache version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment