RewriteEngine On

# 1. Rewrite API requests to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /api/
RewriteRule ^(.*)$ index.php?route=$1 [QSA,L]

# 2. Rewrite everything else to index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.html [L]

