# .htaccess for Telegram Bot & Game Engine
# Compatible with cPanel, Apache 2.2 / 2.4 & LiteSpeed

AddDefaultCharset UTF-8

# Error handling
ErrorDocument 404 /waremp/bot.php

# Security headers
<IfModule mod_headers.c>
    Header always set X-Content-Type-Options nosniff
    Header always set X-XSS-Protection "1; mode=block"
</IfModule>

# Protect sensitive files safely (compatible with Apache 2.2 & 2.4)
<FilesMatch "\.(json|txt|log)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# Protect backup archives
<FilesMatch "^(backup_.*\.zip|.*\.bak|.*\.swp)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# Enable compression if available
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json
</IfModule>
