| Ligne 5 : | Ligne 5 : | ||
RewriteCond %{HTTP:X-Forwarded-Proto} =https | RewriteCond %{HTTP:X-Forwarded-Proto} =https | ||
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA] | RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA] | ||
}} | }}<br> | ||
== Redirect http to https == | == Redirect http to https == | ||
{{syntaxhighlight |lang=text |code= | {{syntaxhighlight |lang=text |code= | ||
# Redirect HTTPS to HTTP
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA]
# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA]