2

I have an SSL certificate for my domain, let's call it example.com. Also I have another domain, let's call it example.net

When I get HTTPS requests for domain example.net it fails but example.com it works. I want to redirect HTTPS requests for example.net to https://example.com.

Notice: they are both hosted on the same server (Ubuntu 14.04 - Apache 2.4). I tried a CNAME record for example.net to redirect it to example.com but also fails (my browser tell's me that the certificate is vaild only for example.com).

So what to do? Do I have to get another SSL certificate for example.net?

6

If you want both sites to support HTTPS, including a mere redirect, you need both to have valid certificates.

There is no way to bypass this as it is part of the well-thought mechanism that protects the user from being led to the wrong site.

  • what about getting a cert for my ip because the websites are hosted on same server ?! – IamPublic Aug 8 '16 at 5:00
  • Because no visitor is coming to your site(s) by entering https://<ip-address> as the URL and the URL a needs to match the certificate. – HBruijn Aug 8 '16 at 5:03
  • 1
    @IamPublic: I don't see where the issue comes from as certificates cost next to nothing anyways and if you need both domains to work, you need two certificates, period. – Julie Pelletier Aug 8 '16 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.