RewriteEngine On
# --- Paksa HTTPS dan tanpa www ---
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.wgce\.ac\.in$ [NC]
RewriteRule ^(.*)$ https://wgce.ac.in/$1 [L,R=301]
# --- Aturan Cache Control ---
ExpiresActive On
# Default: cache 1 bulan
ExpiresDefault "access plus 1 month"
# Gambar
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# CSS & JS
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Fonts
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
# HTML (jangan lama-lama)
ExpiresByType text/html "access plus 600 seconds"
# Pastikan cache invalid kalau file berubah
Header set Cache-Control "public, max-age=31536000, immutable"
Header set Cache-Control "no-cache, no-store, must-revalidate"