move main domain into separate folder

101wc

Registered
Sep 14, 2013
1
0
1
cPanel Access Level
Website Owner
Hi,

When I create a new account in WHM no subfolder for domain.com is created. This makes quite a mess when you add numerous addon domains, especially when you use something like WordPress on the main account domain, as it's full with WordPress folders AND addon domain folders, eg:

[domain2]
[domain3]
[domain4]
[domain5]
[domain6]
[wp-content]
[wp-admin]
[wp-include]
.htaccess
error_log
index.php
license.txt
readme.html
sitemap.xml
sitemap.xml.gz
softver.txt
wp-activate.php
wp-blog-header.php
wp-comments-post.php
wp-config.php
wp-cron.php
wp-links-opml.php
etc.

How can I manage it so every domain, including the main domain has it's subfolder, so like

[domain1]
[domain2]
[domain3]
[domain4]
[domain5]
[domain6]

Your help is *very* appreciated, as I'm new to cPanel and WHM, tia!
 

quietFinn

Well-Known Member
Feb 4, 2006
1,222
87
178
Finland
cPanel Access Level
Root Administrator
If you have root access you can change the root folder of the primary domain in:
/var/cpanel/userdata/$username/$domain.com
and then run this to rebuild the Apache configuration:
/scripts/rebuildhttpdconf