views:

22

answers:

1

Hi there, I've got a client who recently changed their name. They had an SSL certificate for their site, and I was using mod_rewrite to ensure all requests to domain1.com and www.domain1.com went to https://domain1.com.

Now that they are domain2.com, I'd like everything to go to https://domain2.com. Not so easy, it turns out. I have everything working right except for requests to https://domain1.com. That doesn't get rewritten and it trips the domain mismatch error for the SSL cert.

Here's my rewrite rules:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain2\.com$ [NC]
RewriteRule .? https://domain2.com%{REQUEST_URI} [R=301,L]

Any advice you could provide would be greatly appreciated!

Aaron.

A: 

You need a SSL certificate including domain1.com and domain2.com (costs more).

Luper Rouch
But I don't want to secure domain1.com anymore. I just want anyone who enters that old domain to be redirected to the new one.
Aaron Vegh
Not sure what to do in this case, maybe your browser triggers an SSL alert because you redirect from one https domain to another and the user may not notice it. I would redirect domain1's https requests to a static page on domain1 http, with a link to the new domain.
Luper Rouch