# ============================================================
# AVENE ESPORTS - PUBLIC .htaccess
# This should be your hosting "Document Root".
# ============================================================

Options -Indexes
RewriteEngine On

# Prevent PHP execution inside uploads folder (critical: stops
# an attacker who uploads a malicious .php disguised as an image)
<IfModule mod_php.c>
    <Directory "uploads">
        php_flag engine off
    </Directory>
</IfModule>

<FilesMatch "\.php$">
    <If "%{REQUEST_URI} =~ m#^/uploads/#">
        Require all denied
    </If>
</FilesMatch>

# Cache static assets aggressively
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/webp "access plus 1 month"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
</IfModule>

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