How can I change the default subdomain directory?
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? :-)
-
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. 0 -
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! 0 -
You should be able to leave the invite code field blank and create a new account for the feature request system. Thank you. 0 -
hi Has this idea been implemented? 0 -
@wahabalemi - at this time, users can create subdomains outside of public_html. Is that what you were looking for? 0 -
how can do it 0 -
When you create the subdomain inside cPanel it will ask you where you want to create the document root. I have attached a screenshot showing this defaults to /home/username/directory_name instead of /home/username/public_html: 0 -
@wahabalemi 1st go to WHM -> Server Configuration -> Tweak Settings -> Domains and set "Restrict document roots to public_html " => Off 0
Please sign in to leave a comment.
Comments
8 comments