I assume your issue is the certificate error when the page is accessed through one of the other hostnames. In this case, rewriting won't help because the error happens at SSL handshake time which ist before all other request processing in apache.
If you can get certificates for the other hostnames, too, you can install mod_gnutls which supports "server name indication", so you can use name-based virtual hosts for ssl, too.
If not, you can change your web application's logic (maybe define the primary domainname somewhere as a class constant) to always use the primary hostname when linking to a https page.
|