cPanel & WHM Version 92 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Improve Domain and Subdomain Directory Structure under public_html

coder4life shared this idea 6 years ago
Open Discussion

Currently the directory structure of domains and sub-domain is very difficult to manage for users and administrators. Organization is key to having a visual understanding of structures of a website under domains and sub-domains.


The current behavior is the primary domain of an account becomes the root directory of the public_html account:

/home/{account_name}/public_html/[site_files (aka. root of site files)]

Domain:

/home/{account_name}/public_html/[site_files]

Sub-Domain:

/home/{account_name}/public_html/test/[site_files]


Although you can get around this behavior with clever .htaccess rules and manually creating the folder structure, it becomes more cumbersome for users. As per the User Interface and User Experience coming to cPanel, updates should be focused on these inconsistencies in both the interface and organization of files. It is also worth noting that if a directory structure is referenced in an application it cannot be used because it is currently reserved for the sub-domain name.


The proposal is to slightly alter the structure and naming conventions of files and folders generated automatically by cPanel scripts. This should be fully backwards compatiable and could even provide a simple update script to move files and structures appropriately.


Under public_html this is the new proposed structure:

/home/{account_name}/public_html/{domain_or_sub-domain}/[site_files]

Domain:

/home/myaccount/public_html/domain.com/[site_files]

Sub-domain:

/home/myaccount/public_html/test.domain.com/[site_files]


The benefits here are more consistency as well as a decrease of support overhead required with trying to explain the directory structure.

Comments (4)

photo
3

From a hosting perspective, having the sub domain in a sub folder of the main domain is cause for many support tickets. .htaccess rules have to be will crafted to exclude sub domains from misbehaving, custom php directives get applied to domains that ought not get them.


The fix for this is a simple change to /usr/local/cpanel/base/frontend/x3/addon/index.html to make the default addon domain location inside of the /home/myaccount/ directory.

photo
1

This feature will implement the first part, main domain being in a different folder than public_html) http://features.cpanel.net/responses/as-a-website-owner-i-would-like-my-main-domain-to-use-a-subfolder-like-addon-domains-so-that-i-can-have-better-multidomain-setups


I agree that subdomains should default to folders with their full name and not just what's before the parent domain

photo
3

Hey all! While this specific request has not been address, there is a change in v58 that is in the same theme. We added a tweak-setting option that allows you to set the default document root that is suggested to your users: inside public_html, or inside the docroot.


12b88646954824f0035afcddf9cf225c