Our company has recently changed the domain name for one of our produce websites, and wants all traffic from the old to be redirected to the new.
Right now that comes up with a privacy error as the ssl is on www.newdomain.com instead of www.olddomain.com.
Is there anyway to redirect www.olddomain.com to www.newdomain.com without it reporting this error? My suspicion is that I will need to install an SSL on the old domain as well but would like to avoid this if possible.
I have so far attempted to do this via the vhost and/or htaccess, and aliasing the old domain in the new domains conf file, eg:
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [L,R=301,NC]