# Static assets: no script execution, no listings, no vendor archives/docs.

Options -Indexes

# Nothing in a static asset tree should ever be executed
<IfModule mod_php.c>
    php_flag engine off
</IfModule>
<IfModule mod_php7.c>
    php_flag engine off
</IfModule>
<IfModule mod_php8.c>
    php_flag engine off
</IfModule>

<FilesMatch "\.(php|php[0-9]|phtml|phps|phar|pht|inc|shtml|shtm|cgi|pl|py|rb|sh|bash|exe|dll|so|bat|cmd|com|scr|msi|vbs|htaccess|htpasswd)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# Vendor archives, docs and manifests are not part of the running site
<FilesMatch "\.(zip|tar|tgz|gz|7z|rar|md|markdown|lock|dist|map|sql|bak|old|orig|log|ini|sh|yml|yaml)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

<IfModule mod_mime.c>
    RemoveHandler .php .php3 .php4 .php5 .php7 .php8 .phtml .phps .pht .cgi .pl .py .rb .sh .shtml
    RemoveType .php .php3 .php4 .php5 .php7 .php8 .phtml .phps .pht
    AddType text/plain .php .php3 .php4 .php5 .php7 .php8 .phtml .phps .pht
</IfModule>
