Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 am trying to redirect without a rewrite rule from eg to . I have a wildcard certificate for * . This yields the following warning in my error_log

[warn] RSA server certificate wildcard CommonName (CN) `*' does NOT match server name!?

This makes sense and I understand why the warning. I would like to ask if there is a way to use the Redirect directive to accomplish the above without the warnings. Here is my virtual hosts in ssl.conf:

<VirtualHost *:443>
    SSLEngine on
    DocumentRoot /var/www/html/domain

    SSLOptions -FakeBasicAuth -ExportCertData +StrictRequire +OptRenegotiate -StdEnvVars
    SSLStrictSNIVHostCheck off

<VirtualHost *:443>
    SSLEngine on
    Redirect permanent /

Also, if there is a solution, can it be used for redirection from htps:// to htps:// Thanks a lot!

share|improve this question
up vote 2 down vote accepted

Please be aware that the SSL handshake and verification process of the underlying HTTPS connection occurs before the actual request is sent. That means no HTTP response from the server before the authenticity of the server certificate has been verified, not even redirects.

If you only have one endpoint (ie. only 1 public IP address), you'll need to buy a SAN certificate, that is, a certificate with Subject Alternative Names.

That way you could have a wildcard certificate for * with the SAN, and you won't get any certificate warnings

For further info, check out an old answer I gave for a similar situation, just with nginx instead of apache

share|improve this answer (and for that matter are not the same domain as, hence the warning. You should have certificates for those domains as well, if you need to avoid this warning.

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.