# Deny all direct access to uploaded files
<Files "*">
    Require all denied
</Files>

# Prevent script execution
<FilesMatch "\.(php|phtml|php3|php4|php5|pl|py|cgi|sh|exe)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# Only allow access via download script
<FilesMatch "^\.(pdf|doc|docx|xls|xlsx|ppt|pptx|jpg|jpeg|png|gif|zip|rar|7z)$">
    Require all denied
</FilesMatch>
