# ==========================================================
# CodingBurg Bangla News Portal - Apache .htaccess
# Optimized for Shared cPanel Hosting (public_html)
# ==========================================================

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Prevent directory browsing
    Options -Indexes

    # Set default charset
    AddDefaultCharset UTF-8

    # Pass all requests to index.php unless file or directory exists
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

# Prevent direct access to sensitive core files
<FilesMatch "^(config\.php|\.env|composer\.json|package\.json)$">
    Order allow,deny
    Deny from all
</FilesMatch>

# Enable Gzip compression if module available
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json image/svg+xml
</IfModule>
