Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I server SSL pages from If a user types in, I want to redirect. I've the got rewrite rule working, but chrome displays an error message because the server identifies itself as instead of, so the rewrite rules don't execute.

Is there any way around this using apache virtual hosts, or do I need multiple certificates/a wildcard certificate?

share|improve this question

migrated from Jul 9 '11 at 10:50

This question came from our site for professional and enthusiast programmers.

This is not a programming question. Please ask this sort of thing on serverfault or webmasters. – Flimzy Jul 9 '11 at 10:38
You'll need multiple certificates or a certificate with multiple CommonName or SubjAltname attributes. Also see and – joschi Jul 9 '11 at 10:40

Like given in other answers here, you have an issues with your certificate.

For the time being you might want to consider using Mod_Rewrite also in this case.

Have look at my answer at How to Redirect to . Be aware of that in that case it was related to HTTP, not HTTPS. Simply make sure you put https:// instead of http:// in the RewriteRule.

RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*)$1 [R=301,L]
share|improve this answer
Unless he has a wildcard certificate this will lead into a certificate error, or not? "Invalid certificate" because the host does not fit with the host in the certificate (with and without www) – strauberry Jul 9 '11 at 11:12

Your Answer


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