A subdomain is a part of your main domain that acts as a separate website or section of your site. For example, blog.example.com
is a subdomain of example.com
. Subdomains are useful for organizing content or hosting separate sections like blogs, forums, or e-commerce stores.
Follow these steps to create a subdomain in cPanel:
Step 1: Log in to cPanel
- Open your browser and navigate to your cPanel login page (e.g.,
https://yourdomain.com:2083
). - Enter your username and password, then click Log in.
Step 2: Access the Subdomains Tool
- Scroll down to the Domains section in the cPanel dashboard.
- Click on Subdomains.
Step 3: Create a Subdomain
-
In the Create a Subdomain section, fill in the following fields:
- Subdomain: Enter the name of the subdomain (e.g.,
blog
,store
, orforum
). - Domain: Select the parent domain from the dropdown menu.
- Document Root: This field will auto-fill based on the subdomain name (e.g.,
/public_html/blog
), or you can customize it to point to a specific directory.
- Subdomain: Enter the name of the subdomain (e.g.,
-
Click Create to add the subdomain.
Step 4: Verify Subdomain Creation
- Once the subdomain is created, you’ll see a success message in cPanel.
- It will also appear in the list of existing subdomains at the bottom of the Subdomains page.
Step 5: Upload Website Files to the Subdomain
- Use the File Manager or an FTP client to upload the website files for the subdomain to its document root directory (e.g.,
/public_html/blog
).
Step 6: Test the Subdomain
- Open your browser and visit the subdomain URL (e.g.,
http://blog.example.com
). - Ensure that it loads correctly and displays the intended content.
Optional: Configure DNS Settings
- If your domain's DNS is managed by an external registrar:
- Log in to your domain registrar's dashboard.
- Add a DNS A Record for the subdomain pointing to your hosting server's IP address.
- Allow 24-48 hours for DNS propagation.
Tips for Subdomain Management
- Organize Content: Use subdomains for sections like blogs, forums, or stores to keep your site well-structured.
- Secure the Subdomain: Use SSL/TLS to enable HTTPS for the subdomain. This can usually be done via cPanel’s SSL/TLS tool or AutoSSL.
- Hosting Limits: Check if your hosting plan has a limit on the number of subdomains you can create.
By creating a subdomain in cPanel, you can effectively expand your website and organize different types of content under your main domain.