# Configuration Apache pour Titoue Quiz
# Active la reecriture d'URL et force l'encodage UTF-8.

AddDefaultCharset UTF-8
AddCharset UTF-8 .html .css .js .json .txt .sql

RewriteEngine On

# Force HTTPS si l'hebergeur le permet.
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Empeche l'acces direct aux helpers PHP internes.
<FilesMatch "^(db|jwt_helper)\.php$">
    Order deny,allow
    Deny from all
</FilesMatch>

# Cache statique (CSS, JS, images).
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/webp "access plus 1 month"
</IfModule>
