# .htaccess BÁSICO - SEM INTERFERÊNCIA COM CPANEL
RewriteEngine On

# URLs limpas para páginas principais (raiz)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(noticias|seguranca|vulnerabilidades|malware|loja|privacidade)/?$ $1.php [L]

# URLs limpas dentro de acesso_restrito
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^acesso_restrito/(noticias|seguranca|vulnerabilidades|malware|loja|privacidade)/?$ acesso_restrito/$1.php [L]

# Página inicial - removido para permitir DirectoryIndex específico por diretório

# Processar arquivos sem extensão como PHP
<FilesMatch "^(noticias|seguranca|vulnerabilidades|malware|loja|privacidade)$">
    SetHandler application/x-httpd-php
</FilesMatch>

# Segurança básica de arquivos
<Files ".env">
  Require all denied
</Files>
<Files "config.php">
  Require all denied
</Files>

# Cache básico
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>

# O CPANEL VAI ADICIONAR SUA CONFIGURAÇÃO DE AUTENTICAÇÃO AQUI AUTOMATICAMENTE

#----------------------------------------------------------------cp:ppd
# Section managed by cPanel: Password Protected Directories     -cp:ppd
# - Do not edit this section of the htaccess file!              -cp:ppd
#----------------------------------------------------------------cp:ppd
AuthType Basic
AuthName "Protected 'public_html/acesso_restrito'"
AuthUserFile "/home/protecaonarede/.htpasswds/public_html/acesso_restrito/passwd"
Require valid-user
#----------------------------------------------------------------cp:ppd
# End section managed by cPanel: Password Protected Directories -cp:ppd
#----------------------------------------------------------------cp:ppd