How to Create and Use Subdomains
Subdomains allow a logical separation of your website into many distinct sections. Subdomains look like this: subdomain.yourdomain.com, where subdomain is the name of the subdomain, and yourdomain is your domain name.
Here are some common subdomains:
http://forum.yourdomain.com (used for the installation of a forum application on a subdomain)
https://secure.yourdomain.com (used for a secured access to a subdomain)
http://private.yourdomain.com (used for a private access to a section of your hosting account)
Why create a subdomain?
- Subdomains allow a physical separation of your website into different sections.
- Each subdomain can have its own FTP access, different from the main FTP access.
- Secure transactions can be completed on a subdomain with an SSL certificate.
- Each subdomain can have its own DNS entries, allowing advanced manipulations.
How to create a subdomain?
- Connect to your cPanel
- Under Domains, click on SubDomains
- Under Create a subdomain,enter the subdomain's name and select the main domain affected in the roll-down menu.
- The Document Root box will be automatically filled with the value public_html/subdomain, where subdomain is the name of the subdomain chosen in step 3. This represents the folder which will hold the subdomain's files. Let's say you upload a file test.html in the public_html/subdomain/ folder. This file will then be accessible on the internet at this address: http://subdomain.yourdomain.com/test.html. It is recommended to keep the suggested root document, unless you have a good reason to change it.
- Click on Create to create the subdomain.
How to manage subdomains
You can manage your subdomains from the same cPanel page, under SubDomains and Modify a Subdomain. You will find all the created subdomains and their management tools to their right.
Document Root contains a link allowing you to directly modify a subdomain's files with cPanel's File Manager.
In the Actions column, you will find two tools: Manage Redirection and Delete. The Manage Redirection option allows you to redirect the subdomain to another address. For example, you could create a subdomain m which implements mobile access to your site; the address m.mydomain.com would then take you to an interface designed to be viewed on mobile devices. The Delete link allows you to delete the selected subdomain.
Article ID: #HC5053