# Protection des fichiers sensibles
<FilesMatch "(config\.php|dbConnect\.php)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# Autoriser l'accès temporaire pour le test (à commenter après test)
<Files "test_db_connection.php">
    Allow from all
</Files>

# Désactiver la liste des répertoires
Options -Indexes

# URL Rewriting
RewriteEngine On
RewriteRule ^api/functions$ Classe/Functions.php [L]

# Activer la compression GZIP
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>

# Cache des fichiers statiques
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
</IfModule>