
# 1. Proibir listagem de diretórios (ninguém vê seus arquivos soltos)
Options -Indexes

# 2. Proteger arquivos sensíveis (Conexão e Config)
<FilesMatch "^(conexao\.php|config\.php|database\.sql)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# 3. Bloquear injeções de código comuns na URL
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} base64_encode [OR]
    RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    RewriteRule ^(.*)$ - [F,L]
</IfModule>

# 4. Forçar HTTPS (Seu cadeado de segurança)
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

