Options -MultiViews
RewriteEngine On
RewriteBase /
# Protect admin directory via server-side auth (see /admin/.htaccess)
# Do not rewrite requests to the physical /admin directory so Apache can enforce directory auth
# Make exclusions case-insensitive so /Admin, /ADMIN etc are treated the same
RewriteCond %{REQUEST_URI} !^/admin(/|$) [NC]
# Do not rewrite requests to the API so PHP files under /api/ are executed
RewriteCond %{REQUEST_URI} !^/api(/|$) [NC]
# Serve existing files normally, otherwise route everything to index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
