Skip to content

Instantly share code, notes, and snippets.

@Kaapiii
Created December 4, 2013 09:42
Show Gist options
  • Select an option

  • Save Kaapiii/7784908 to your computer and use it in GitHub Desktop.

Select an option

Save Kaapiii/7784908 to your computer and use it in GitHub Desktop.
Restrict folder access on Apache by file type
# Restrict folder access (according to permission settings)
# Deny all exept the listed file tpyes
<Files ^(*.jpeg|*.jpg|*.png|*.gif)>
order deny,allow
deny from all
</Files>
# Allow all all listed files
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|mp3|mpg|mp4|mov|wav|wmv|png|gif|swf|css|js)$">
Allow from All
</FilesMatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment