Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have bought an SSL certificate for https://www.domain.com.

Users will be accessing the domain at https://sub1.domain.com, https://sub2.domain.com, etc.

I would like to be able to redirect those subdomains, via Apache. So for instance, https://sub1.domain.com becomes https://www.domain.com/sub1.

Is this possible to do without presenting the user with a "Insecure Connection" error?

share|improve this question

2 Answers 2

If you purchased a wildcard certificate for *.domain.com or had sub1.domain.com and sub2.domain.com listed as Subject Alternative Names on the certificate, you'll be fine. If you bought the cert just for domain.com, then you're out of luck. The users will always see it, since the cert is not valid for that sub-domain and is only valid for domain.com/*.

share|improve this answer

No, because the SSL connection is setup before apache receives the hostname the connection is made with.

You can use startssl.com to obtain certificates for free. At least:

  • one domain for free (or two, if you include www.example.com and example.com (www you get for free).
  • Once you have paid for level 1 and 2 validation, you can request as many multi-domain certificates as you want.

This is not really of help though, because you can't put multiple certificates on the same IP. You could only do this with a multi domain certificate or a wildcard certificate (but wildcard certificates have their limitations).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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