RewriteEngine On

# Si existe fichero/carpeta real, servirlo normal
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Ruteo API bonito: /api/state -> /api/index.php?route=state
RewriteRule ^(.+)$ index.php?route=$1 [QSA,L]
