Options -Indexes
RewriteEngine On

# Força HTTPS se disponível
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# API
RewriteRule ^api\.php$ api.php [L,QSA]
RewriteRule ^api/postback\.php$ api.php [L,QSA]

# Funil limpo: /pedido -> pedido.html (com ou sem barra)
RewriteRule ^(pedido)/?$ pedido.html [L,QSA]
RewriteRule ^(consulta)/?$ consulta.html [L,QSA]
RewriteRule ^(objeto)/?$ objeto.html [L,QSA]
RewriteRule ^(pagamento)/?$ pagamento.html [L,QSA]
RewriteRule ^(pendentes)/?$ pendentes.html [L,QSA]
RewriteRule ^(atualizacao)/?$ atualizacao.html [L,QSA]
RewriteRule ^site/?$ site/index.html [L,QSA]

# Se pedirem .html em pasta inexistente, não loop
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9\-]+)/?$ $1.html [L,QSA]
