Options -Indexes
RewriteEngine On
# Dados, bancos e arquivos temporários nunca devem ser distribuídos pelo navegador.
<FilesMatch "(?i)(\.db(?:-wal|-shm)?$|\.sqlite(?:3)?$|\.log(?:\..*)?$|\.bak$|^key\.json$|^debug_log\.json$|^requests_log\.txt$|^\.env(?:\..*)?$|^composer\.(?:json|lock)$)">
    Require all denied
</FilesMatch>
<IfModule mod_headers.c>
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
# URL do QR Code permanece compatível com o aplicativo.
RewriteRule ^img/qr\.png$ api/qr_png.php [L,NC]
# URLs sem extensão, sem reescrever endpoints ou arquivos existentes.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L]
