1

I have a single server (single IP) and I'd like to host two web apps on it.

I have bought wildcard ssl certificate for *.example.com.

I configured DNS and use Rewrite Rule to redirect (301) from http to https and from www to non-www.

Actually all scenarios works except one:

When I type in address bar sth like:

https://www.subdomain.example.com then I got NET::ERR_CERT_COMMON_NAME_INVALID

When I type https://subdomain.example.com or http://www.subdomain.example.com everything is fine I'm redirected with no warning.

What is important when I do the same for domain - not sub-domain like:

https://www.example.com - I'm redirected to https://example.com with no warning (connection is secure).

I'd like to repeat that I got wildcard cert: *.example.com.

Env: Windows Server 2012R2 + IIS 8.5

Any help / suggestions appreciated.

Piotr Czarnecki
  • 1,688
  • 3
  • 14
  • 22
  • How did you fix this @Piotr Czarnecki ? – lvthillo Aug 01 '18 at 10:56
  • @Ivthillo - So the reason of the problem was actually pretty straightforward. We had wildcard SSL certificate, which allows us to have unlimited first level subdomains. Second thing is that 'www' from DNS point of view is a subdomain as well. So in fact: www.subdomain is second-level subdomain for .example.com -> it is *. *. example.com not *.example.com. To make redirect from SSL firstly SSL need to be established and because I tried to validate second level subdomain it was invalid. So in fact to fully fix it you need to have second certificate for *.subdomain.example.com – Piotr Czarnecki Aug 01 '18 at 13:10
  • I was afraid so, but I'm also reading you can handle the redirect from www to non-www inside the application without buying an additional cert. You know something about that? – lvthillo Aug 01 '18 at 13:16
  • Sorry, I don't know any other working solution. From what I remember most of certificate providers provide www and non-www certificate if you buy 'single domain certificate', but for wildcard which was our case I have no optional answer. – Piotr Czarnecki Aug 01 '18 at 13:33
  • Maybe my case is a little bit different, I've the same redirect and they all work (http://www.example.com -> https://example.com etc) except when I fully type https://www.example.com I face the error from above) – lvthillo Aug 01 '18 at 13:35

0 Answers0