# =========================================================
# Frontend SPA (React Router) — Apache / cPanel
# Estagio 1: forca HTTPS + roteamento SPA. (Headers/CSP vem depois.)
# =========================================================

RewriteEngine On

# Forca HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# SPA: se o caminho NAO for um arquivo nem pasta reais, entrega o index.html
# (deixa o React Router resolver a rota no cliente).
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [L]
