DirectoryIndex index.php
Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On

# The extraction root itself is the Public Edge web base.
# A nested public/ path is invalid in the flat package and is blocked explicitly.
RewriteRule ^public(?:/|$) - [F,L,NC]

# Protect non-public component internals.
RewriteRule ^(?:src|database|resources|tools|storage|var)(?:/|$) - [F,L,NC]
RewriteRule ^(?:config\.php|config\.example\.php|bootstrap\.php|manifest\.json|VERSION\.txt|README\.md|install\.lock)$ - [F,L,NC]

# Setup is a real product surface. Route the directory explicitly instead of
# depending on the host's DirectoryIndex behavior, and never expose a listing.
RewriteRule ^setup/?$ setup/index.php [QSA,L]
RewriteRule ^setup/(?:index\.php|api\.php|setup\.css|setup\.js)$ - [L]

# Physical assets/emergency files are served directly; everything else
# goes through the component-root front controller.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
</IfModule>

<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set X-Frame-Options "DENY"
</IfModule>
