How to Set Up Subdomains in cPanel
A subdomain is a prefix added to your main domain name, allowing you to create separate sections or sub-sections for your website, such as blog.yourdomain.com or shop.yourdomain.com. In cPanel, setting up subdomains is simple and allows you to organize and manage different areas of your website. Here’s how you can set up subdomains in cPanel.
Step 1: Log in to cPanel
- Open your web browser and go to your cPanel login page (typically
http://yourdomain.com/cpanelorhttp://yourdomain.com:2083). - Enter your username and password to log in to your cPanel account.
Step 2: Access the Subdomains Section
- After logging into cPanel, scroll down to the Domains section.
- Click on the Subdomains icon to open the subdomains management page.
Step 3: Create a New Subdomain
-
Enter the Subdomain Name:
- In the Subdomain field, type the name of the subdomain you want to create (e.g.,
blog,store, orhelp). This will create a subdomain such asblog.yourdomain.com.
- In the Subdomain field, type the name of the subdomain you want to create (e.g.,
-
Choose the Domain:
- From the Domain drop-down menu, select the domain under which you want to create the subdomain. If you have multiple domains, ensure you select the correct one.
-
Document Root:
- The Document Root field will automatically fill with a directory path for your subdomain (e.g.,
/public_html/blog). This is the folder where the files for the subdomain will be stored. - You can edit the document root if needed, but it's usually best to leave it as it is unless you have a specific directory structure in mind.
- The Document Root field will automatically fill with a directory path for your subdomain (e.g.,
-
Click "Create":
- Once you've entered the subdomain name, selected the domain, and reviewed the document root, click the Create button.
Step 4: Upload Files to the Subdomain's Directory
- After creating the subdomain, you will need to upload files for that subdomain.
- Open the File Manager in cPanel.
- Navigate to the subdomain's directory (e.g.,
/public_html/blog). - Upload your website files for the subdomain into this folder using the Upload feature in File Manager, or use FTP to transfer the files.
Step 5: Access Your Subdomain
Once the subdomain is created and files are uploaded, you can access your subdomain by visiting:
http://subdomain.yourdomain.com
For example, if you created a subdomain named blog, you can visit http://blog.yourdomain.com to view the content hosted there.
Step 6: Manage Your Subdomain (Optional)
You can always manage your subdomain settings later from the Subdomains section in cPanel:
- Delete a Subdomain: If you no longer need a subdomain, go to the Subdomains section, click Delete next to the subdomain you want to remove, and confirm the deletion.
- Change Document Root: If you need to change the document root for your subdomain, you can update it by clicking Manage Redirection in the Subdomains section.
- Set Up Redirects: You can redirect your subdomain to another website or page using the Redirects tool in cPanel.
Additional Tips:
- DNS Configuration: If your subdomain isn’t resolving, ensure that the DNS for your domain is properly configured. Usually, cPanel automatically sets the necessary DNS records for subdomains.
- SSL for Subdomains: If you have SSL set up for your domain, you may need to install an SSL certificate for the subdomain as well. This can be done in the SSL/TLS section of cPanel.
By following these steps, you can easily create and manage subdomains in cPanel. Subdomains help you organize your website into multiple sections, making it easier to manage content and create a more professional web presence.