# Disable directory listing
Options -Indexes

# Turn off PHP execution inside this folder
<IfModule mod_php7.c>
    php_flag engine off
</IfModule>
<IfModule mod_php8.c>
    php_flag engine off
</IfModule>

# Prevent execution of any script files (PHP, CGI, etc.)
<FilesMatch "\.(php|php[0-9]?|phtml|phar|cgi|pl|sh|py|exe|jsp|asp|aspx)$">
    Require all denied
</FilesMatch>

# Allow safe static files (images, docs, zips, etc.)
<FilesMatch "\.(jpe?g|png|gif|webp|svg|pdf|docx?|xls[xm]?|txt|zip|rar|mp4|mp3|css|js)$">
    Require all granted
</FilesMatch>

# Block hidden files (.htaccess, .env, etc.)
<FilesMatch "^\.">
    Require all denied
</FilesMatch>
