Redirect To Domain Before SSL Is Read

Posted by Devin Dixon on Server Fault See other posts from Server Fault or by Devin Dixon
Published on 2013-06-27T15:20:06Z Indexed on 2013/06/27 16:23 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

I had to switch servers and I want to redirect all SSL urls to the non-ssl site. The problem I am running into is the https site still throws invalid certificate error even through apache has the redirect implemented.

<VirtualHost *:443>
    ServerAdmin [email protected]
    DocumentRoot /data/sites/www.example.com/main/
    RewriteEngine on
    Redirect 301 / http://www.example.com

    SSLEngine on
    SSLCertificateFile    /etc/httpd/ssl/www.examplecom/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/httpd/ssl/www.example.com/ssl-cert-snakeoil.key

    ServerName www.example.com
    ErrorLog "logs/example.com-error_log"
    CustomLog "logs/example.com-access_log" common
</VirtualHost>

My question is, how can I do a redirect and avoid the invalid ssl certifcation error in the browser?

© Server Fault or respective owner

Related posts about apache2

Related posts about ssl