# KI FWI SA YÉ ? — Apache / o2switch
# Site statique intégralement prérendu. Aucun script inline, aucun domaine tiers :
# la CSP peut donc rester stricte sans exception (playbook §2.10).
Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; media-src 'self'; worker-src 'self'; manifest-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none'"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always set X-Frame-Options "DENY"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Permissions-Policy "geolocation=(), camera=(), microphone=(), payment=(), usb=(), interest-cohort=()"
# Le service worker ne doit jamais être servi depuis le cache HTTP,
# sinon une mise à jour du jeu peut ne jamais atteindre l'appareil.
Header set Cache-Control "no-cache"
ExpiresActive On
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType image/avif "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType audio/ogg "access plus 1 year"
Header set Cache-Control "public, max-age=31536000, immutable"
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
AddType application/manifest+json .webmanifest
AddType audio/ogg .opus
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# 404 statique et autonome : lisible même si tout le reste échoue.
ErrorDocument 404 /404.html