How can I change the default subdomain directory?

MWorksMT

Registered
Oct 1, 2015
2
0
1
Bozeman, MT
cPanel Access Level
Root Administrator
Hi there,

We've occasionally had some of our hosted clients run into undesirable effects (cascading .htaccess rules, php.ini configurations, etc.) because their subdomains get created within their /public_html directory.

I'm wanting to change the default to a directory below /public_html to avoid the aforementioned issues.

In other words, when someone goes to create a subdomain within cPanel, the default directory will be something like /subdomains - So instead of the subdomain's root going into /public_html/whatever, it'd go into /subdomains/whatever.

I do have the "Subdomains outside public_html" option enabled in WHM, and realize that one can manually just enter a different directory when creating a subdomain, but it would be nice if I could set the default.

Is there a configuration file somewhere on the server which I can edit to change this? :)
 

cPanelMichael

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

There are no native features that will allow you to change the default populated document root when creating a new subdomain, or to restrict the use of public_html in the document root. This is a good idea for a feature request:

Submit A Feature Request

Thank you.
 

MWorksMT

Registered
Oct 1, 2015
2
0
1
Bozeman, MT
cPanel Access Level
Root Administrator
Hi Michael,

Thanks for your response to my post.

I clicked the link you provided, which suggests that I am automatically logged into the Feature Request site, but upon trying to submit a request I am prompted to login. The system is then unable to find my account.

Are you able to send me an invite code so that I might submit the feature request?

Thank you, Michael!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
You should be able to leave the invite code field blank and create a new account for the feature request system.

Thank you.