# cPanel sometimes uses public/ as DocumentRoot for Node.js apps.
# If sub-paths 500 but homepage works, ensure this file exists on the server.
#
# PassengerAppRoot must stay in the PARENT folder .htaccess (app root).
# This file only prevents broken fallbacks and serves real static files.

Options -Indexes -MultiViews

<IfModule mod_rewrite.c>
    RewriteEngine On

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

    # Serve only files that actually exist under public/ (favicon, etc.)
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    # Do NOT RewriteRule to index.php or index.html — Passenger + server.js handle routes
</IfModule>
