How to set subdomain root folder using cPanel for Bluehost, Hostgator ...
When creating a new subdomain using cPanel a folder is automatically created using the subomain name. For example if I create the subdomain 'shop.mydomain.com', a folder called 'shop' is created in the root of this domain. Sometimes this automatically assigned folder name is not acceptable. Maybe it conflicts with other folders.
However, when using the X3 theme of cPanel it is possible to define the folder name when creating a subdomain. To determine if your version of cPanel is using the X3 theme, login to cPanel and check the URL in your browser. If you see 'x3' in the URL you are using the X3 theme.
If your hosting company has not enabled the X3 cPanel theme, ask them to do so. Bluehost use this theme as standard, and Hostgator will enable it if your submit a support ticket.
Once you have the X3 theme enabled, create a new subdomain and you will see the following form:
In the 'Document Root' control you can specificy the folder to use for the subdomain. It is not possible to set the folder of an already created subdomain. However, it is easy to delete a subdomain, and then re-create it, specify the new folder to use.
I wish to ask is that how to differentiate between subdomain and folder in the public_html?
What I mean is that, my domain name is www.example.com. I assign example1 as sub domain, then it will become www.example1.example.com, and you can find the folder in public_html/folder.
However if you create a folder call example1 under www.example.com, it will become www.example.com/example1. You can find this folder in public_html/folder as well?
SO i am abit confuse, why both is categorised in public_html/folder, it will be great is someone can reply me via mail.
Hi Alvin.
When you create a subdomain a folder with that name is created in the public_html folder. So if you create a example1 sub domain the following folder will be created: 'public_html/example1'. This folder is accessible from example1.example.com, or via example.com/example1.
If you create a folder in the public_html folder it does not automatically create a sub domain for you.
I hope this helps.
Darren