The browser compares the certificate with the domain name before Rails even gets the opportunity to touch it - this is actually the very first part of the negotiations with the server, so you can not even use Apache Rewrite to change it.
What you need to do is add mydomain.com to your certificate. They are called the Unified Communications Certificate, although GoDaddy simply calls them the certificate of several domains. http://help.godaddy.com/article/3908
source share