Scenario:
A.COM, B.COM, C.COM. A & B.COM are registered with SSL. All three sites host entries are in single server in /etc/hosts with respective domain name.
Question:
When I type https://C.COM (non-ssl site). It automatically redirects to A.COM (ssl site).
There is no entries made in DNS (Godaddy) and server host entry for such behaviour.
Can somebody help me understand why is this happening ?
It’s not clear what you mean by “registered with SSL”. You don’t “register” with SSL. I presume you mean you’ve configured a certificate for HTTPS on the server(s) listening at the address(es) for
a.comandb.com.Since all 3 domains have entries in
/etc/hosts, from that machine’s point of view, DNS resolution is irrelevant: thehostsfile will be used to give the client the IP address for each domain.You’re not saying whether
a.com,b.comand/orc.comshare IP addresses.When you type
https://c.comin your browser, it gets the IP address forc.com(which presumably is the same as that ofa.com) and makes an SSL/TLS connection to it (on port 443). It gets the certificate presented by the server (it should show a warning message if you get a certificate that’s not valid forc.com). The reason you geta.comis probably becausea.comis the default host served on that IP address (and you haven’t configuredc.com).