{{tag>ssl apache}} ====== http to https redirect ====== Enable rewrite engine in non-ssl conf. RewriteEngine on RewriteCond %{SERVER_NAME} =yoursite.com [OR] RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] In ssl conf add Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/yoursitename/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/yoursitename/privkey.pem Example of ssl.conf ServerName yoursite.com ServerAlias www.yoursite.com ServerAdmin webmaster@localhost DocumentRoot /var/www/yoursite AllowOverride All Options FollowSymlinks ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/yoursite.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/yoursite.com/privkey.pem ====== Tested on ====== * ====== See also ====== ====== References ======