Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine On
  # Pretty health check
  RewriteRule ^health$ server.php?__health=1 [L,QSA]
  # Optional /mcp alias
  RewriteRule ^mcp/?$ server.php [L,QSA]
</IfModule>

# Block sensitive / non-public paths
<IfModule mod_authz_core.c>
  <FilesMatch "^(config\.php|composer\.(json|lock)|\.env.*|php\.ini)$">
    Require all denied
  </FilesMatch>
</IfModule>

<IfModule !mod_authz_core.c>
  <FilesMatch "^(config\.php|composer\.(json|lock)|\.env.*|php\.ini)$">
    Order allow,deny
    Deny from all
  </FilesMatch>
</IfModule>

# Deny browsing into these directories
RedirectMatch 403 ^/(src|vendor|sessions|cgi-bin)/
RedirectMatch 403 \.(zip|md|lock)$
