# ============================================
# CLOAKER VIA .HTACCESS (ALTERNATIVA)
# ============================================
# Opção 1: Redirecionar todas as requisições pelo cloaker
# Opção 2: Usar auto_prepend_file do PHP

# ------ OPÇÃO 1: USAR WRAPPER PHP ------
# Renomeie index.html para _index.html e index.php para index.php (wrapper)
# DirectoryIndex index.php index.html

# ------ OPÇÃO 2: AUTO PREPEND (MAIS SIMPLES) ------
# Inclui o cloaker automaticamente em todos os arquivos PHP
# php_value auto_prepend_file "/caminho/completo/para/cloaker.php"

# ------ OPÇÃO 3: BLOQUEAR POR GEO IP (SE SERVIDOR SUPORTAR) ------
# Requer mod_geoip ou MaxMind DB instalado no servidor
# <IfModule mod_geoip.c>
#     GeoIPEnable On
#     SetEnvIf GEOIP_COUNTRY_CODE BR AllowCountry
#     Deny from all
#     Allow from env=AllowCountry
# </IfModule>

# ------ BLOQUEAR ACESSOS SUSPEITOS ------
# Bloqueia alguns user agents suspeitos
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Bloqueia bots suspeitos
    RewriteCond %{HTTP_USER_AGENT} (curl|wget|python|scrapy|httpclient|java|libwww) [NC]
    RewriteRule .* - [F,L]
</IfModule>

# ------ SEGURANÇA ADICIONAL ------
# Bloqueia acesso a arquivos sensíveis
<FilesMatch "\.(json|log|txt|md)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# Permite apenas pendentes.json, aprovados.json, etc via PHP
<FilesMatch "^(pendentes|aprovados|rejeitados)\.json$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
