Is there any way to make it redirect before the browser throws a cert error?
migrated from stackoverflow.com Sep 12 '09 at 1:42
Yes, but not how you think.
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.
There is a way round it. You can get a single cert for both www.domain.com and domain.com. Then you can use a regular redirect. These multi-domain certificates are generally more expensive though.