fix(redirection): redirige HTTP vers HTTPS via .htaccess

- Ajoute les règles mod_rewrite pour forcer HTTPS
- Gère les reverse proxies via X-Forwarded-Proto
- Exclut le chemin Let's Encrypt .well-known/acme-challenge
This commit is contained in:
2026-07-07 23:59:52 +04:00
parent 36d1e307bd
commit 37eeee07dd
+9
View File
@@ -1,3 +1,12 @@
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect HTTP to HTTPS, including behind reverse proxies
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
<IfModule mod_headers.c> <IfModule mod_headers.c>
# Force HTTPS for one year # Force HTTPS for one year
Header always set Strict-Transport-Security "max-age=31536000" Header always set Strict-Transport-Security "max-age=31536000"