Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We've got our website running and HTTPS / SSL works just great.

EXCEPT: when users enter and then enter the secure area and get directed to it works fine.

But when users enter just and then enter the secure are and get directed to they get a warning about the certificate being from a website called while they're trying to enter ....

Does our SSL cert not cover both and Are we suppose to buy TWO certs, on for each?? Surely not?

Any help or pointers to the standard way of doing things like this would be great. We're using Apache HTTPD to forward requests to Tomcat web apps. Apache is taking care of all the SSL connections.

share|improve this question

2 Answers 2

SSL, be default, covers one domain. In your case it's Users who go to will see that error message as is not explicitly covered by that SSL certificate.

To over come this you can:

1) Get a wild card SSL certificate which covers subdomains in addition to the main domain. This is nice as it's flexible and let's you encrypt as many subdomains as you want but also a lot more expensive.

2) Redirect your users from to Besides being easy to do and free, it's also smart usability as it gives your users a consistent URL to use (and see).

To do this in Apache you can put this in an .htaccess file in your root web directory:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
share|improve this answer
I'm having trouble getting those commands to have any effect. I've posted another question detailing my entire setup at the moment. Would be great if you could take a look there? – Nick Foote Mar 22 '11 at 9:58

By default, it does not. You have to buy a wild-card ssl certificate to get that working. You can also specify multiple hosts in the ssl certificate.

Another option is to always redirect to a canonical domain. In this case, it makes sense to redirect from to

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.