How to Create a Subdomain
Subdomains are extensions of a domain. They function separately from the main domain, thus they can be used to host additional websites. The format of a subdomain is: subdomain.domain.com.
Let’s say we have a domain mywebsite.com and we want to create a forum and a blog for the main site. We could locate them on forum.mywebsite.com and blog.mywebsite.com. These subdomains can also be accessed via mywebsite.com/forum and mywebsite.com/blog.
To create a subdomain, access subdomains section in cPanel.
- Subdomain field represents the name of a subdomain. In this section, only the subdomain extension has to be entered.
- Domain field lets you choose the domain under which the subdomain will be created.
- Document Root is the root directory of a subdomain. This folder is created in public_html by default.
- After clicking Create, this message will appears on your screen.
If any errors or issues are encountered during this step, the hosting provider should be contacted for assistance.
Uploading files to subdomain Document Root
All files/scripts should be uploaded to the Document Root directory specified in Step 2. The directory is automatically created in public_html and can be easily accessed using File Manager section of cPanel. If a subdomain is created using an Addon Domain, the subdomain’s Document Root will be created inside the root directory of the addon domain, for example: public_html/addon_domain_root/subdomain_root.
Deleting a subdomain
If a subdomain is no longer required, or the name was enterred incorrectly, it is always possible to remove it. A subdomain can be deleted by pressing the Remove button in cPanel->Subdomains section.
IMPORTANT! The root directory and files of the subdomain will not be removed. A manual deletion will have to be performed by using the File Manager or any FTP client.
If the goal is to create a subdomain with a different name while displaying the same content, the best way would be to delete the old subdomain and create a new one with the same root directory as the deleted subdomain.
To sum up, subdomains are a fast, cheap and effective way to create additional websites, as there is no need to purchase additional domain names. They can also be used to set up specific areas for your main website, such as a forum, blog, shop etc.
- Subdomains are separately functioning domain extensions.
- Subdomain DNS configuration can be changed without affecting the main domain.