# Disable script execution
Options -ExecCGI -Indexes
RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .php8 .pl .py .jsp .asp .htm .shtml .sh .cgi

# Force to run as plain text if it somehow gets executed
<FilesMatch "\.(php|php[3-8]|phtml|pl|py|jsp|asp|htm|shtml|sh|cgi)$">
    SetHandler text/plain
    Require all denied
</FilesMatch>

# Deny everything else
<FilesMatch "(?i)\.(.*)$">
    Require all denied
</FilesMatch>

# Only allow specific image formats
<FilesMatch "(?i)\.(jpg|jpeg|png|webp)$">
    Require all granted
</FilesMatch>
