<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    # Redirecionar todas as requisições para o arquivo index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

# Definir o tipo de conteúdo para arquivos conhecidos
<IfModule mod_mime.c>
    AddType application/javascript .js
    AddType application/json .json
    AddType application/xml .xml
    AddType application/x-www-form-urlencoded .url
    AddType application/x-font-ttf .ttf
    AddType application/x-font-opentype .otf
    AddType application/x-font-woff .woff
    AddType application/font-woff2 .woff2
    AddType application/vnd.ms-fontobject .eot
    AddType application/font-sfnt .sfnt
    AddType application/font-woff .woff
    AddType font/ttf .ttf
    AddType font/otf .otf
    AddType font/woff .woff
    AddType font/woff2 .woff2
    AddType image/svg+xml .svg .svgz
    AddType text/css .css
    AddType text/html .html .htm
    AddType text/javascript .js
    AddType text/plain .txt
    AddType text/xml .xml
</IfModule>

# Desabilitar a listagem de diretórios
Options -Indexes

# Configurar cabeçalhos de segurança
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-XSS-Protection "1; mode=block"
    Header set Referrer-Policy "same-origin"
</IfModule>

# Habilitar compressão Gzip
<IfModule mod_deflate.c>
    <FilesMatch "\.(js|css|html|xml|json|txt)$">
        SetOutputFilter DEFLATE
    </FilesMatch>
</IfModule>
