Both example.com and www.example.com with SSL

user1032531 asked:

I obtained a free CA certificate from https://www.startssl.com/.

I added the domain name example.com, and in the control panel, it shows www.example.com under SSL/TLS Server, and example.com under Domain Validations.

I configured Apache (running on Centos) per the instructions, and can access https://example.com/ without a “Untrusted Connection” warning, but when accessing https://www.example.com/, I get the warning.

How can I either rewrite https://www.example.com/ to https://example.com/, or configure the certificate to also work with http://example.com/?

My answer:


You were meant to obtain an SSL certificate for www.example.com, not example.com.

Add subdomain in StartSSL certificates wizard

When you do this, StartSSL will give you a certificate that works for both hostnames.

Ready to create certificate


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.