Last active
June 10, 2019 15:54
-
-
Save bmatthewshea/d6ffdc731973b856e15095aa95704a29 to your computer and use it in GitHub Desktop.
Sample redirect from apache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName domain.com | |
ServerAlias *.domain.com *.www.domain.com | |
ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/domain.com-access.log common | |
Redirect 301 / https://www.domain.com/ | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName www.domain.com | |
ServerAlias *.domain.com *.www.domain.com | |
ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/domain.com-access.log common | |
SSLEngine On | |
SSLCompression off | |
SSLProtocol all -SSLv2 -SSLv3 | |
SSLCertificateKeyFile /etc/letsencrypt/live/redirect.domain.com/privkey.pem | |
SSLCertificateFile /etc/letsencrypt/live/redirect.domain.com/cert.pem | |
SSLCertificateChainFile /etc/letsencrypt/live/redirect.domain.com/chain.pem | |
</VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName domain.com | |
ServerAlias *.www.domain.com | |
ErrorLog ${APACHE_LOG_DIR}/redirect-domain.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/redirect-domain.com-access.log common | |
Redirect 301 / http://www.domain.com/ | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName www.domain.com | |
ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/domain.com-access.log common | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment