Options -Indexes -MultiViews
RewriteEngine On
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^robots\.txt$ robots.php [L]

# Conserver l'accès direct aux fichiers, aux médias et à l'administration.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Adresses publiques lisibles : /page, /article/titre et /en/page.
RewriteRule ^([a-z]{2,3}(?:-[a-z0-9]{2,8})?)/article/([a-z0-9-]+)/?$ index.php?lang=$1&p=article/$2 [QSA,L,NC]
RewriteRule ^article/([a-z0-9-]+)/?$ index.php?p=article/$1 [QSA,L,NC]
RewriteRule ^([a-z]{2,3}(?:-[a-z0-9]{2,8})?)/([a-z0-9-]+)/?$ index.php?lang=$1&p=$2 [QSA,L,NC]
RewriteRule ^([a-z]{2,3}(?:-[a-z0-9]{2,8})?)/?$ index.php?lang=$1 [QSA,L,NC]
RewriteRule ^([a-z0-9-]+)/?$ index.php?p=$1 [QSA,L,NC]
<FilesMatch "^(inc\.php|aries-config\.json|\.aries-installed|README.*\.md|INSTALLATION\.md|GUIDE-UTILISATEUR\.md|SECURITY\.md|SUPPORT\.md|LICENSE\.txt|CHANGELOG\.md|aries-update\.json)$">
  Require all denied
</FilesMatch>
<FilesMatch "(^|/)\.(?!well-known)">
  Require all denied
</FilesMatch>
<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set X-Frame-Options "SAMEORIGIN"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
  <FilesMatch "\.(css|js)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
</IfModule>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml
</IfModule>
