I am trying to migrate a whole site to a different server and want to create htaccess to ensure that it correctly redirects old content while handling new content, too.

That old domain is a straightforward website landing page that includes a catalog.html code page and three sites: /images, /styles, /fonts.

Whenever someone navigates towards the old domain, I would like the website landing page to load. That's, when the user navigates to:

They stick to stated URL.

In every other situation, Let me execute a 301 redirect. For instance:

Regrettably, I can not quite appear to nail the correct regular expression to handle initial cases for that website landing page.

Do this code:

Options +FollowSymlinks -MultiViews
RewriteEngine on

# for http    
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC] 
RewriteCond %{SERVER_PORT} =80
RewriteRule . http://NewDomain.com%{REQUEST_URI} [R=301,L]

# for https
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC] 
RewriteCond %{SERVER_PORT} =443
RewriteRule . https://NewDomain.com%{REQUEST_URI} [R=301,L]