# ==============================================================================
# 2º CONCURSO DE BANDAS DE GARAGEM – CASTELHANOS MOTO ROCK
# Configurações de Segurança e Servidor Apache (.htaccess)
# ==============================================================================

# 1. Charset Padrão UTF-8
AddDefaultCharset UTF-8

# 2. Desabilitar Listagem de Diretórios (Protege contra visualização de pastas)
Options -Indexes

# 3. Proteger Arquivos Sensíveis
<FilesMatch "^(database\.sql|error_log\.txt|\.env.*|\.git.*|composer\..*)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# 4. Proteger a pasta includes
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^includes/ - [F,L]
</IfModule>

# 5. Cabeçalhos de Segurança
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# 6. Página Inicial Padrão
DirectoryIndex index.html index.php
