# Allow access to uploaded images while blocking script execution
Options -Indexes

<IfModule mod_authz_core.c>
    Require all granted
</IfModule>

# Block PHP and other scripts from executing in uploads for security
<FilesMatch "\.(php|php5|phtml|phar|cgi|pl|asp|aspx)$">
    Require all denied
</FilesMatch>

# Helpful headers
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
</IfModule>

# Ensure common image types are served with correct MIME
<IfModule mod_mime.c>
    AddType image/jpeg .jpg .jpeg
    AddType image/png .png
    AddType image/gif .gif
    AddType image/webp .webp
</IfModule>
