# Une note pour chacun – configuration Apache
# Pas de liste des fichiers d'un dossier (si l'hébergeur refuse cette ligne -> erreur 500 : mettez un # devant)
Options -Indexes
DirectoryIndex index.html index.php
ErrorDocument 404 /404.html
AddDefaultCharset UTF-8
AddType application/manifest+json .webmanifest
AddType application/rss+xml .xml
# Adresse officielle : toujours https://www.unenotepourchacunasbl.be
# (ne touche pas aux adresses de test : sous-domaines, autres domaines)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^unenotepourchacunasbl\.be$ [NC]
RewriteRule ^ https://www.unenotepourchacunasbl.be%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.unenotepourchacunasbl\.be$ [NC]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://www.unenotepourchacunasbl.be%{REQUEST_URI} [L,R=301]
# Les données et fichiers techniques ne sont jamais accessibles
RedirectMatch 403 ^/data/
Require all denied
Order allow,deny
Deny from all
Require all granted
Order allow,deny
Allow from all
# Anciennes adresses WordPress -> nouvelles
RedirectMatch 301 ^/ecoute-le-cd/?$ /nos-actions/cd-ecoute-ma-chanson-2/
RedirectMatch 301 ^/actualites/cd-ecoute-ma-chanson/?$ /nos-actions/cd-ecoute-ma-chanson-2/
RedirectMatch 301 ^/wp-admin/?$ /admin/
RedirectMatch 301 ^/wp-login\.php$ /admin/
RedirectMatch 301 ^/wp-content/themes/unpc_test/Media/(.*)$ /uploads/audio/$1
RedirectMatch 301 ^/wp-content/uploads/(.*)$ /uploads/$1
RedirectMatch 301 ^/wp-content/themes/[^/]+/pdf/(.*)$ /uploads/documents/$1
RedirectMatch 301 ^/(comments/)?feed/?$ /actualites/flux.xml
RedirectMatch 301 ^/(wp-sitemap|sitemap_index)\.xml$ /sitemap.xml
RedirectMatch 301 ^/(category|tag|author)/.*$ /actualites/
# Compression et cache navigateur (site plus rapide = meilleur référencement)
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml application/xml application/rss+xml text/plain application/manifest+json
ExpiresActive On
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType audio/mpeg "access plus 1 month"
ExpiresByType font/woff "access plus 1 year"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"