Change document root of Cpanel account that is not the main domain

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Hey there! I believe you'd be better off changing your local hosts file, as the IP/~username may not always follow everything setup on the machine. Can you try this instead to see if that gives you better results?

 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Yes, but instead of visiting with IP/~username you would just be able to visit domain.com, and then Apache would handle the document root properly.

If you check the Apache configuration manually at /etc/apache2/conf/http.conf, do you see the document root has been updated there?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
While we don't support changing it for newly-created accounts, you can use the details in the article here to manually change the docroot:


It just isn't something that can be done through WHM as we don't encourage those types of changes.