If you have to change your domain name and you want to point more than one domain to one specific domain then the best thing to do is redirect them via a 301 redirect to one of the domains.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [R=301,L]

So now the olddomain versions will be redirected to the newdomain url.

Redirecting Domain Names