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:

Creating a subdomain with cPanel X3 theme

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.

folder and subdomain

alvin (not verified) on Mon, 09/15/2008 - 08:23

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.

Small difference

darren on Tue, 09/16/2008 - 16:47

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

Setting www into it's own folder

Larissa (not verified) on Wed, 11/19/2008 - 18:45

Can I somehow also set that www.domain.com is actually fetched from the sub-folder "www"?

cPanel doesn't allow to create "www" as a subdomain on its own ...

Reason I want to achieve that is so that I do have the files for www.domain.com cleanly in a separate folder just as for any other subdomain.

It should be like that:

Domain hello.domain.com will be found in /home/username/public_html/hello
Domain goodbye.domain.com will be found in /home/username/public_html/goodbye
Domain www.domain.com will be found in /home/username/public_html/www

Any ideas how to do that?

It depends on whether the

darren on Fri, 11/21/2008 - 18:19

It depends on whether the domain is the main domain on the account (parked domain) or an extra domain on the account (add-on domain).

Parked domains always have to use the root foler (public_html). So for a parked domain you can specify the folder to user.

For an add-on domain, when you add the domain you specify the folder then, just like a sub-domiain. So you can add a www folder.

setting diferent document root for public_html www.domain.com

Anonymous (not verified) on Thu, 12/03/2009 - 21:16

Just remove public_html folder, create the desired folder and then create a symbolic link named public_html to the new folder :)

When creating a new

boediger (not verified) on Sat, 04/18/2009 - 11:34

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.

boediger

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <img>
  • Lines and paragraphs break automatically.

More information about formatting options