My company just migrated to WordPress and during the migration we were using a test domain (n.domain.com) to test and develop the new website.
After completion we switched the DNS from “n.domain.com” back to our original domain name of “www.our-updated-site.com.” Both domains are on the same server.
We recently discovered that Google has indexed many of the pages using the “n.domain.com” domain name.
I would like to know how to set up a RewriteRule in the .htaccess that would redirect any “n.domain.com” page to their “www.our-updated-site.com” counterpart?
Read more here: How to switch just the domain name but leave the url slug alone