Ssl – How to redirect https://domain.com to https://www.domain.com using IIS

301-redirectcertificatessl

I have a 301 set up which redirects http://domain.com to http://www.domain.com (http://www.domain.com$S$Q) but if I browse to https://domain.com I get an SSL error (as it expects www.domain.com).

Is there any way to make it redirect before the browser throws a cert error?

Best Answer

Yes, but not how you think.

  • You will need a valid certificate for domain.com
  • You will need domain.com and www.domain.com to have separate public IP addresses

If you can't do that, you're out of luck, unfortunately. You can't use HOST headers to differentiate between the two requests, because that's far too late (thus, separate IP addresses). And unless you have a valid certificate, the browser is going to choke, so you also need the 2nd cert.

There's no way around these requirements, I'm afraid.

Related Topic