Options -Indexes
RewriteEngine On

# If the request is for an existing file or directory, serve it directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Route API calls
RewriteRule ^api/(.*)$ api/index.php [QSA,L]

# Default: serve landing page
RewriteRule ^$ index.php [L]
