Limiting access to (some) files in uploads dir

All you need to do is add a .htaccess file with the following content in your uploads dir:

<FilesMatch ".(xlsx|xls|docx|doc|rtf|odf|pdf)$">
 Order Allow,Deny
 Deny from All

If you want to limit just any file from being accessed from anyone, just use “./*” instead of the regular expression.


Leave a Reply

Your email address will not be published. Required fields are marked *