Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Apache virtualhost config for HTTP redirect to HTTPS
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ErrorLog /var/log/apache2/error-ssl.log
CustomLog /var/log/apache2/access-ssl.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/
SSLCertificateKeyFile /etc/letsencrypt/live/
<VirtualHost *:80>
ServerAdmin webmaster@localhost
Redirect permanent /
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment