I've run into a bit of a problem with an SSL certificate giving a cert_error for the https://domain.com version of our website, however the certificate works just fine with the WWW version, and am not sure how to fix this to avoid any possibility having this error come up.

Ideally I'd like to have all requests to https://domain.com redirected to https://www.domain.com, but I'm not sure how to set up the .htaccess file in order to achieve this. I've found a bunch of stuff on 301 redirects in general, but I can't seem to find anything that touches on this specific set of circumstances.

I'm guessing my other option is to somehow allow my SSL certificate to also work on the non-WWW version, but I wasn't the one who bought or installed the certificate in the first place, so I have absolutely no idea about how to go about this either so I'm guessing the .htaccess option might be easier to implement, if it is in fact possible.

Any help on this one would be greatly appreciated.