Apache Redirect from https to https

Posted by Nikolaos Kakouros on Server Fault See other posts from Server Fault or by Nikolaos Kakouros
Published on 2012-11-30T17:41:29Z Indexed on 2012/12/01 23:07 UTC
Read the original article Hit count: 284

Filed under:
|
|
|
|

I am trying to redirect without a rewrite rule from eg https://www.domain.com to https://www.domain.net . I have a wildcard certificate for *.domain.net . This yields the following warning in my error_log

[warn] RSA server certificate wildcard CommonName (CN) `*.domain.net' 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
    ServerName www.domain.net
    DocumentRoot /var/www/html/domain

    SSLOptions -FakeBasicAuth -ExportCertData +StrictRequire +OptRenegotiate -StdEnvVars
    SSLStrictSNIVHostCheck off
</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    ServerName www.domain.com
    ServerAlias www.domain.info
    Redirect permanent / https://www.domain.net
</VirtualHost>

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

© Server Fault or respective owner

Related posts about apache2

Related posts about ssl