From c922750e77e8f4b0ce5d2d93b1065d5aeca30828 Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Tue, 20 Dec 2016 17:21:01 +0100 Subject: [PATCH] Merge HTTP and HTTPS vhost --- HowtoApache.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HowtoApache.md b/HowtoApache.md index 1910cf39..71c34c97 100644 --- a/HowtoApache.md +++ b/HowtoApache.md @@ -214,19 +214,19 @@ Exemple pour générer un certificat auto-signé : La configuration d'un VirtualHost pour HTTPS pourra ainsi ressembler à : ~~~{.apache} - + ServerName secure.example.com ServerAlias www.example.com example.com - RewriteEngine On - RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R=permanent] - - -[...] + SSLEngine on SSLProtocol all -SSLv2 -SSLv3 SSLCertificateKeyFile /etc/ssl/private/private.key SSLCertificateFile /etc/ssl/certs/certificate.crt #SSLCertificateChainFile /etc/ssl/certs/certificates_chain.pem + + RewriteEngine On + RewriteCond %{HTTPS} !=on + RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R=permanent] ~~~