# ===============================
# SECURITY HARDENING FOR STATIC SITE
# ===============================

# Disable directory listing
Options -Indexes

# Block PHP execution completely
<FilesMatch "\.(php|phtml|php3|php4|php5|php7|php8|phps)$">
  Require all denied
</FilesMatch>

# Block access to hidden and sensitive files
<FilesMatch "(^\.|\.env|composer\.(json|lock)|package(-lock)?\.json|yarn\.lock|readme|license|\.log$)">
  Require all denied
</FilesMatch>

# Security headers
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Permissions-Policy "geolocation=(), microphone=(), camera=()"
</IfModule>

# Disable server signature
ServerSignature Off