I am wanting to redirect my secondary domain to my .com primary domain, such that when I visit domain.asia or www.domain.asia it redirects the URL to https://www.domain.com. The problem I am having is that the redirect goes to https://www.domain.asia (not the .com) and the .asia domain does not have a security certificate and because of this shows a warning.
How can I visit domain.asia and have it redirected to https://www.domain.com?
The secondary domain is parked on the same server as the primary domain. Here is my .htaccess file:
# redirect to .com
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.co\.uk$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.asia$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
# redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# redirect to https if not
RewriteCond %{HTTPS} !=on
rewritecond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]