I have a Centos 7 server configured for multisite web hosting. One of the things I'm trying to do with this server is redirect traffic to old subdomains to subdirectories on our primary website. The primary site is NOT on this same server.
I have tried a ton of configurations using pure VirtualHost config as well as .htaccess. I can always get it working with HTTP but never with HTTPS as this VirtualHost has no SSL cert and I can't buy one for it only to redirect traffic.
So, http://bort.example.com redirects to https://www.example.com/bort just fine, but https://bort.example.com gives a security error about an invalid cert always.
My current theory is that without a cert on the redirect server, apache is refusing to even process the .htaccess file, so I've gotten rid of it completely and tried to distill the VirtualHost configuration down to the simplest possible method. This is what I have right now.
<VirtualHost *:80>
ServerName bort.example.com
Redirect / https://www.example.com/bort
</VirtualHost>
<VirtualHost *:443>
ServerName bort.example.com
Redirect / https://www.example.com/bort
</VirtualHost>
This still works fine with HTTP traffic. What am I missing to get this working with https://bort.example.com?
Edit: It looks like another site on this server, lisa.example.com, that does have an SSL cert may be a contributing factor. The actual error received when trying to reach https://bort.example.com is this:
bort.example.com uses an invalid security certificate.
The certificate is only valid for the following names:
lisa.example.com
Error code: SSL_ERROR_BAD_CERT_DOMAIN
*:80
. 80 is the port of http. You should check the portion of config of your https.