Ohne URLs

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.DOM$ [NC,OR]
        RewriteCond %{HTTP_HOST} ^www\.OLDDOMAIN\.DOM$ [NC]
        RewriteRule ^/.*         https://www.NEWDOMAIN.DOM [R=301,L]
</IfModule>

Mit URLs

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.DOM$ [NC,OR]
        RewriteCond %{HTTP_HOST} ^www\.OLDDOMAIN\.DOM$ [NC]
        RewriteRule ^/(.*)$         https://www.NEWDOMAIN.DOM/$1 [R=301,L]
</IfModule>