Options -Indexes
DirectoryIndex index.php

# Bloqueia arquivos sensíveis
<FilesMatch "^(config\.php|config\.exemplo\.php|LEIA-ME\.md)$">
  Require all denied
</FilesMatch>

# Força HTTPS (descomente depois que o SSL do subdomínio estiver ativo)
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Atalhos antigos (continuam valendo):  /t/tt/3 = teste da vitrine 3 vindo do TikTok;  /c/ig/3 = checkout da vitrine 3 vindo do Instagram
# Páginas das ferramentas:  /preco-receita  (página)  ·  /preco-receita/tt  (página vinda do TikTok)  ·  /preco-receita.json  (dados para o n8n)
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^t/([a-z0-9_-]+)/([0-9]+)/?$ teste.php?o=$1&v=$2 [QSA,L]
  RewriteRule ^c/([a-z0-9_-]+)/([0-9]+)/?$ comprar.php?o=$1&v=$2 [QSA,L]
  RewriteRule ^entrar/?$ entrar-codigo.php [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z0-9-]+)\.json$ pagina.php?s=$1&json=1 [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z0-9-]+)/([a-z0-9_-]+)/?$ pagina.php?s=$1&o=$2 [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z0-9-]+)/?$ pagina.php?s=$1 [QSA,L]
</IfModule>
