# ----------------------------------------
# Basic Configuration
# - Core server settings
# - Character encoding
# ----------------------------------------

# Character Encoding
AddDefaultCharset UTF-8
AddCharset UTF-8 .html .css .js .xml .json .txt

# Enable Rewrite Engine
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # Remove tracking parameters while preserving other query strings
    RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(srsltid|fbclid|gclid|_ga|_gl)=[^&]+(.*)$ [NC]
    RewriteRule ^(.*)$ /$1?%1%3 [R=301,L,NE]
</IfModule>

# Performance Headers
<IfModule mod_headers.c>
    Header set Connection "keep-alive"
</IfModule>

# Ensure content is compressed before being cached
<IfModule mod_headers.c>
    Header set Cache-Control "no-transform"
    Header unset ETag
</IfModule>
FileETag None