# ── API taxitaxi — front controller + proteção ──────────────────────────────
RewriteEngine On

# Encaminhar o header Authorization (alguns hosts removem-no por omissão)
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Bloquear acesso direto a código sensível
RewriteRule ^(config|lib|controllers|data|sql)(/|$) - [F,L]

# Bloquear dotfiles (.htaccess, .sqlite-journal, etc.)
RewriteRule (^|/)\. - [F]

# Tudo o resto é despachado pelo router
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
