# SPA fallback for Apache / LiteSpeed (Hostinger).
# Without this, refreshing a deep route (e.g. /dashboard/accounting) returns a
# 404 because no static file exists there. This serves index.html for any
# request that isn't a real file or directory, so the client-side router can
# handle the route.
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Serve existing files and directories as-is (assets, images, etc.).
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Everything else falls back to the SPA entry point.
  RewriteRule ^ index.html [L]
</IfModule>
