Created
September 21, 2017 15:58
-
-
Save apphp/d5460584ee57af33510f7dfcfed44838 to your computer and use it in GitHub Desktop.
Prevent Access to a Specific File/s in .htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: http://www.apphp.com/index.php?snippet=htaccess-prevent-access-to-single-file-or-multiple-files | |
# Prevent viewing of a specific file | |
<files file.jpg> | |
Order allow,deny | |
Deny from all | |
</files> | |
# Prevent access to multiple file types | |
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd)$"> | |
Order Allow,Deny | |
Deny from all | |
</FilesMatch> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment