# Prevent direct access to uploaded files except images and PDFs
<Files "*">
    Order Deny,Allow
    Deny from all
</Files>

<FilesMatch "\.(jpg|jpeg|png|gif|pdf)$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

# Prevent execution of PHP files
<FilesMatch "\.php$">
    Order Deny,Allow
    Deny from all
</FilesMatch>

# Prevent viewing of hidden files
<FilesMatch "^\.|~$">
    Order Allow,Deny
    Deny from all
</FilesMatch>
