Skip to content

Instantly share code, notes, and snippets.

@DilwoarH
Created October 1, 2019 00:57
Show Gist options
  • Save DilwoarH/98a28d904f48e325bfbe9fdfad1660f7 to your computer and use it in GitHub Desktop.
Save DilwoarH/98a28d904f48e325bfbe9fdfad1660f7 to your computer and use it in GitHub Desktop.
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@edusensys.com
Redirect 301 / https://www.example.com
DocumentRoot /var/www/example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^/(.*) https://www.example.com/$1 [L,R]
ErrorLog ${APACHE_LOG_DIR}/example-com-ssl-error.log
CustomLog ${APACHE_LOG_DIR}/example-com-ssl-access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment