httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack M. Nilles" <jnil...@jala.com>
Subject Re: [users@httpd] Configuring redirects from http to https
Date Mon, 03 Dec 2018 19:17:01 GMT
I quickly discovered that when a test of host2 returned the host1 index page. So I changed
the second VirtualHost address to be the same as host1 (aaa.bbb.ccc.ddd:80). That seems to
have solved the problem. So now the actually working  *.conf is as follows (as a template?):

Listen 80
# Listen 443 not included since it was already listening

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com
 Redirect / https://www.host1.com/
 ErrorLog /var/log/apache2/host1.com-error80_log
 CustomLog /var/log/apache2/hos1.com-access80_log combined
</VirtualHost>

<Virtualhost aaa.bbb.ccc.ddd:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
 Redirect / https://www.host2.com/
 ErrorLog /var/log/apache2/host2.com-error80_log
 CustomLog /var/log/apache2/host2.com-access80_log combined
</VirtualHost>

# https version
<VirtualHost aaa.bbb.ccc.ddd:443>

 ServerAdmin webmaster@host0.com
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com
 DocumentRoot "/<wherever your root is>"
 SSLEngine on
 SSLProtocol all -SSLv2
 SSLCertificateFile /etc/apache2/ssl.crt/<certificate>.crt
 SSLCertificateKeyFile /etc/apache2/ssl.key/<key>.key
 SSLCertificateChainFile /etc/apache2/ssl.crt/<chain file>.txt
 RewriteEngine On
 RewriteOptions Inherit

et cetera



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message