How to Create a Subdomain

How to Create a Subdomain

When you create a subdomain in cPanel, you will be asked to choose the name of the subdomain, the domain the subdomain is for and the location from which the new subdomain will load it’s content.

We do have a video tutorial which will show you how to create a subdomain in cPanel.

Note: Some subdomain names are reserved: mail, www, ftp, cpanel, whm, webmail, webdisk. You can use any name except these.

How to Create a Subdomain

  1. Log into cPanel.
  2. In the Domains section, click on the Subdomains icon.
  3. In the Subdomain field, select the name of the subdomain you wish to use. For example, if you choose blog, your subdomain will be:

    blog.example.com

  4. In the adjacent drop-down menu, select the domain for which you wish to create this subdomain. You may create a subdomain for any addon domain or parked domain that already exists in your cPanel.
    Note: Addon domains automatically create a corresponding subdomain that reflects the addon domain and primary domain.
  5. Click on the Document Root field and it should automatically populate with a suggested location from which the subdomain will load it’s content.
    • For instance, if you chose “blog” as your new subdomain, then the Document Root field will populate with /public_html/blog. This means that the new subdomain will load it’s content from the folder named blog from within the public_html directory.
  6. Once all three fields are set, simply click Create to complete the creation of your new subdomain.

Document Root for Subdomains

If you have addon domains or parked domains for which you wish to have the same subdomain name but wish for those subdomains to load different content, then pay close attention to the Document Root field when creating a subdomain.

Why Document Roots Cannot be the Same

This is very important because if you create blog.hostgator.com and blog.seohosting.com on the same cPanel, but leave the Document Root as the cPanel suggested location, both of your blog subdomains will load from the same directory of /public_html/blog and you will not have separate content for each subdomain.

Furthermore, if you own several domains and wish to have a different blog set up for each domain that loads from the subdomain name blog, then you will have to change the document root of each domain that you set up.

How to Avoid Duplicate Document Roots

To avoid this issue, when you create your new subdomain, make sure you set the document root to something other than /public_html/blog; instead, set it to something like /public_html/blog1. If you have done this correctly, then you will have more than one domain using blog as a subdomain, but both subdomains will be loading separate content.