Return to Snippet

Revision: 72635
at October 3, 2017 05:56 by apphp-snippets


Initial Code
# 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>

Initial URL
http://www.apphp.com/index.php?snippet=htaccess-prevent-access-to-single-file-or-multiple-files

Initial Description
This example shows you how to restrict to a specific file or multiple files. Add the following code block and edit the file name/s according to yuor needs.

Initial Title
Prevent Access to a Specific File/s in .htaccess

Initial Tags
file, htaccess

Initial Language
Bash