0

I have multiple vhosts (apache) and these are all just http. Recently I added an https vhost and found that using https on any of these domains would redirect to the ssl site.

For example, there's: http://example1.com

and the ssl site:

https://example4.com

So the issue is that if someone would go to https//example.com it would redirect to https//example4.com

I tried some redirects in the vhosts but that didn't appear to work. Any help would be greatly appreciated. Thanks.

2 Answers2

0

Make your regular sites accept connections on *:80,*:443

then make your SSL site only accept connections on hostname:443,hostname:80

Vasili Syrakis
  • 4,558
  • 3
  • 22
  • 30
0

With HTTP protocol you can have virtual hosts, that is multiple names mapping to the same IP address. However HTTPS protocol natively maps a single name to a single IP address (and vice-versa: a single IP back to a single domain). Basically vhosts are haven't been possible over HTTPS. There is a recent work around in HTTPS (Server Name Indication or Unified Communications Certificate SSL certificates) but it isn't yet perfected - it won't work for older clients and some mobile clients won't work.

The problem is that HTTPS is still fundamentally a single IP/name pair. Vhosts allow several names to resolve to the same IP (example.com-> sharedIP) but because https only supports a single name the results are being undone (sharedIP-> example4.com)

You've two solutions:

  1. Buy a wildcard certificate for all virtual domains (prices can escalate) so that when any site is visited the HTTPS and the HTTP can match.

  2. Move the SSL hosted domain to an IP by itself (basically undo virtual hosting) so that no other domains get the SSL certificate.

Rudu
  • 301
  • 1
  • 5
  • 8
  • Thanks guys, great responses, I really appreciate it. I looked at all the options and it looks like adding an additional ip dedicated to the ssl site would be the best way to go. – vivithemage Feb 04 '14 at 14:01