DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On
# Pass the Authorization header through to PHP (required on CGI/FastCGI hosts
# where Apache strips it - without this every Bearer-token call returns 401).
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Keep real files and directories accessible.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Route clean TiviGlass API paths into the panel front controller.
RewriteRule ^(account|api|sync|billing)/(.*)$ index.php?route=/$1/$2 [QSA,L]
RewriteRule ^health/?$ index.php?route=/health [QSA,L]
</IfModule>
