How to Create a Subdomain in cPanel

SubdomainsYou can create subdomains in cPanel, which can be used for creating websites seperate from your main website, or as redirects to any URL (web address).

An example of a subdomain is subdomain.example.com, where example.com is your main domain, and subdomain.example.com is your subdomain.

Creating the Subdomain

Video Tutorial

Step-by-Step Directions

To create a subdomain, follow the directions below:

  1. Log into cPanel.
  2. Look for the Domains section, and click on the Subdomains icon.
  3. Enter the Subdomain you wish to use. 
    • For example, if your domain is example.com, and you want your subdomain to be stuff.example.com, then you would enter “stuff” in the field before the domain.
  4. Select the Domain you want to use from the list.
    • if you only have one domain name on this account, it may not ask you for a domain name.
    • You can choose from your primary domain name and any addon domains you previously added.
  5. Enter the Document Root, which is where the files for the website will reside. 
    • We recommend naming the folder something you will recognize when uploading files later.
    • You can create a new folder, or point it to an existing folder if you wish.
  6. Click on the Create button.

Anything you upload or install in the folder your selected is what will appear on the subdomain.  If you pointed the subdomain to an existing folder, whatever is already in that folder is what will appear on the new subdomain.

Redirecting a Subdomain

Instead of displaying something in a folder on the sever, you can instead redirect the domain to any valid URL (web address).

  1. Create the subdomain using the directions above.
  2. Go back to the Subdomains screen, if not already there.
  3. Find the subdomain you want to redirect on the list.
  4. Click on Manage Redirection link.
  5. Enter the URL you wish to redirect the subdomain to.
  6. Click on the Save button.

Disabling Redirection:

To disable, repeat the above steps, but click Disable Redirection instead of Save in the last step.

Video Tutorial

Possible Pitfalls

DNS Settings

Your subdomains will not work if you do not have your DNS properly set up.  If you are using the name servers provided by your hosting provider, and cPanel is handling your DNS, then your subdomains will automatically be configured.

If you are not using the DNS servers provided by your web host, you will have to setup the DNS on your name servers to get the subdomain to work.

Might Not Work Immediately / DNS Propagation

For new subdomains, it usually starts working immediately, but it is possible there is a delay before the subdomain works.  This is especially true if you previously used this subdomain elsewhere, and are now using it on a new web host or server.  If that is the case, it may take 4 to 8 hours before your subdomain starts working.

Subdomain was Previously Redirected

If the subdomain you created was previously redirected, you may need to clear your browser's cache to get your computer to forget the redirect.

Your browser will automatically "forget" on its own when the cache expires, but that could take awhile.

Recommended Content

1 Comment