0

I used to have a domain which used to have a SSL Certificate, it still does have. But I have changed the domain, and I also have a new SSL Certificate for that new domain.

I still have users accessing the site via https://shabbasheep.myolddomain.com and it gives me the This is probably not the site that you are looking for!

But when they access the site via shabbasheep.myolddomain.com it redirects them correctly to shabbasheep.mynewdomain.info

Here is how my apache entries look like, got an idea to this from here

<VirtualHost *:80>
    ServerName shabbasheep.myolddomain.com

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} shabbasheep.myolddomain.com$
    RewriteRule ^(/(.*))?$ https://shabbasheep.mynewdomain.info$1 [L,NC,R=301]  
</VirtualHost>

My SSL

<VirtualHost *:443>
    ServerName shabbasheep.mynewdomain.info
    ServerAlias www.mynewdomain.info

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} shabbasheep.myolddomain.com$
    RewriteRule ^(/(.*))?$ https://shabbasheep.mynewdomain.info$1 [L,NC,R=301]  

    SSLEngine on
    SSLCertificateFile "mypathto.crt"
    SSLCertificateKeyFile "mypathto.pem"
    SSLCACertificateFile "mypathto.crt"

    ...    
    ...
    ...
</VirtualHost>

Apologies in advance if this is a duplicate question, I did have a look around, but nothing seems to work, or may be due to my lack of understanding.

Could some one guide me on this.

Thanks in advance.

1 Answer 1

3

You need to create a separate virtual host for your old domain, which has the certificate and private key of the old domain installed. Then you can put your rewrite rule there.

Currently your virtual host will catch all domains, and therefore it presents the new domain certificate to clients connecting to the server, including ones that want to connect to old domain.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .