My primary domain is primary.com
and I added an alias domain for it alias.com
, I also added subdomain sub.primary.com
and install SSL certificate to it .. Until this point every thing works well.
The issue is that when I request to visit the subdomain using the primary name sub.primary.com
the SSL works well, But If I request it using the alias name sub.alias.com
the browser gives an SSL certificate error
Certificate is not valid
This server could not prove that it is sub.alias.com; its security certificate is from sub.primary.com. This may be caused by a misconfiguration or an attacker intercepting your connection.
I deleted all the codes that causing the redirection, So now there is not any code on any domain.
So .. What is the reason that makes the SSL certificate not work with pos.orders.ly