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/hmazter.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hmazter.com/privkey.pem
</VirtualHost>
</IfModule>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
Redirect permanent / https://www.hmazter.com/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment