Apache

Redirect https to http

# Redirect HTTPS to HTTP
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA]


Redirect http to https

# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA]


Utiliser https sur Apache en local

Voir Utiliser HTTPS en local sur Apache

  • installer openssl

voir How to Install OpenSSL on Windows 11 or 10 via Command or GUI - H2S Media

  • ajouter le certificat
"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" req -config openssl.cnf -new -out site.csr
"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" rsa -in privkey.pem -out site.key
"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" x509 -in site.csr -out site.cert -req -signkey site.key -days 365
"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" x509 -in site.cert -out site.der.crt -outform "DER 9"

Liens Externes

MediaWiki spam blocked by CleanTalk.