DirectoryIndex index.html index.php

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{HTTP:x-xsrf-token} .
    RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]

    # Laravel owns API, health/release, Sanctum, and storage paths.
    RewriteRule ^(?:api(?:/|$)|up(?:/|$)|sanctum(?:/|$)) index.php [L,QSA]

    # Serve real frontend/static files directly.
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # React SPA fallback.
    RewriteRule ^ index.html [L]
</IfModule>
