force https

This commit is contained in:
quenousimporte 2024-08-27 10:40:59 +02:00
parent 6bc2a004fd
commit 6aeeeb22ca
1 changed files with 12 additions and 0 deletions

12
.htaccess Normal file
View File

@ -0,0 +1,12 @@
RewriteEngine on
# Redirection du www vers non-www en HTTPS
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301]
# Redirection vers HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# See https://ouvaton.coop/certificat-ssl/