Part move domain name, keep emails

MarkPW

Member
Jun 8, 2003
16
0
151
I want to move/301 redirect all urls, including subdomains on olddomain.com to newdomain.com, but prevent everything in olddomain.com/static/ from redirecting. I also want to keep olddomain.com email accounts active and working.

My plan is to keep the primary URL in WHM as olddomain.com and add newdomain.com as a parked/alias domain name, and assuming both domains use the same root directory, add rewrite rules to htaccess to 301 any request for olddomain to newdomain except olddomain.com/static/. I also have 2 subdomains I want to redirect, 1 of which uses document root /home/olddomain/public_html/forum/ and the other /home/olddomain/public_html/.

My question is will this work or is there a better way in cPanel/WHM to achieve this? Will parking newdomain.com work with the subdomains and their respective document roots?

Thanks for any help.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello :)

The method you described should work, depending on which Mod_Rewrite rules you add to the .htaccess file. You can add subdomains associated with the parked domain names. Documentation on parked domain names is available at:

cPanel - Parked Domains

Thank you.