# Public media folder: cloud AI services download files from here.
# Nothing in this folder may ever be executed.
Options -Indexes -ExecCGI
RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .php8 .phar .pl .py .cgi .shtml
RemoveType .php .phtml .php3 .php4 .php5 .php7 .php8 .phar
<IfModule mod_php.c>
    php_flag engine off
</IfModule>
<IfModule mod_php7.c>
    php_flag engine off
</IfModule>

# Deny everything, then allow only media files.
<IfModule mod_authz_core.c>
    Require all denied
    <FilesMatch "\.(?i:jpe?g|png|webp|mp4|mov|webm|m4v|wav)$">
        Require all granted
    </FilesMatch>
</IfModule>
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    <FilesMatch "\.(?i:jpe?g|png|webp|mp4|mov|webm|m4v|wav)$">
        Allow from all
    </FilesMatch>
</IfModule>

<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set Content-Security-Policy "default-src 'none'; sandbox"
</IfModule>
