# Uploaded files are DATA, never code.
# php_flag is deliberately NOT used: it is invalid under PHP-FPM/CGI
# (cPanel's usual setup) and returns HTTP 500. Handler removal works
# across every PHP SAPI.

Options -ExecCGI -Indexes

RemoveHandler .php .phtml .php3 .php4 .php5 .php6 .php7 .php8 .phps .cgi .pl .py
RemoveType    .php .phtml .php3 .php4 .php5 .php6 .php7 .php8 .phps

<FilesMatch "\.(php|phtml|php[0-9]|phps|cgi|pl|py|sh|htaccess)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Deny from all
    </IfModule>
</FilesMatch>

# Only ever serve the image types the uploader accepts.
<FilesMatch "\.(jpe?g|png|webp|gif)$">
    <IfModule mod_authz_core.c>
        Require all granted
    </IfModule>
</FilesMatch>
