Options -Indexes
DirectoryIndex index.php

# Apache/PHP-FPM strips the Authorization header by default; pass it to PHP for Bearer API keys.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_setenvif.c>
    SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
<FilesMatch "^(README\.md|router\.php)$">
    Require all denied
</FilesMatch>
<IfModule mod_headers.c>
    Header always set X-Content-Type-Options "nosniff"
    Header always set Referrer-Policy "same-origin"
</IfModule>

<IfModule mod_mime.c>
    AddType application/manifest+json .webmanifest
</IfModule>

# Versioned asset URLs (?v=commit) may be cached for a long time.
<IfModule mod_headers.c>
    <FilesMatch "\.(css|js|png|svg|webp|woff2?)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
</IfModule>
