What is a Subdomain?
A subdomain is a subset of your main domain that functions as a separate website section. It appears before your domain name, like blog.example.com or shop.example.com.
blog.yoursite.comBlog section
shop.yoursite.comOnline store
support.yoursite.comHelp desk
portal.yoursite.comCustomer portal
Why Use Subdomains?
Organization
- • Separate different sections
- • Cleaner URL structure
- • Easier navigation for users
Technical Benefits
- • Different applications on same domain
- • Separate content directories
- • Different PHP versions possible
SEO Considerations
- • Organize content topically
- • Treated separately by search engines
- • Good for distinct content types
Creating a Subdomain
Step 1: Access Subdomains
- Log in to cPanel
- Navigate to "Domains" section
- Click "Subdomains"
Step 2: Configure Subdomain
- Subdomain: Enter the prefix (e.g., "blog")
- Domain: Select parent domain from dropdown
- Document Root: Directory for subdomain files (auto-filled, e.g., public_html/blog)
Step 3: Create Subdomain
Review settings and click "Create". The subdomain is created instantly.
Subdomain Directory Structure
Default Layout
public_html/
├── index.html (main site: example.com)
├── blog/
│ └── index.html (subdomain: blog.example.com)
├── shop/
│ └── index.html (subdomain: shop.example.com)
└── support/
└── index.html (subdomain: support.example.com)Custom Paths
You can place subdomains anywhere:
public_html/sites/blog/ (custom location)
public_html/applications/shop/ (another custom path)Managing Subdomains
Modify Subdomain
- Find subdomain in the list
- Click "Manage" or edit icon
- Change document root if needed
- Click "Change"
Remove Subdomain
- Find subdomain in list
- Click "Remove"
- Confirm deletion
Note: Removing a subdomain doesn't delete files in the directory. Files remain until manually deleted.
SSL Certificates for Subdomains
AutoSSL
- Automatically installs SSL for subdomains
- Usually within 24 hours of creation
- Check SSL/TLS Status in cPanel
Wildcard SSL
- • Covers all subdomains: *.example.com
- • More expensive but convenient for many subdomains
- • Available from SSL certificate providers
Common Use Cases
Development/Staging
dev.yoursite.com (development)
staging.yoursite.com (staging)
test.yoursite.com (testing)Different Services
blog.yoursite.com (WordPress)
forum.yoursite.com (phpBB)
wiki.yoursite.com (MediaWiki)Geographic/Language
us.yoursite.com (US version)
uk.yoursite.com (UK version)
es.yoursite.com (Spanish)Customer Portals
portal.yoursite.com (customer login)
admin.yoursite.com (admin panel)
api.yoursite.com (API endpoint)Troubleshooting
Subdomain Not Loading
- • Wait for DNS propagation (can take 24-48 hours)
- • Verify document root contains files
- • Check file permissions (755 for directories, 644 for files)
- • Clear browser cache
Wrong Content Displayed
- • Verify document root path is correct
- • Check if index file exists in subdomain directory
- • Ensure no redirect rules are interfering
SSL Not Working
- • Wait 24 hours for AutoSSL to issue certificate
- • Run AutoSSL manually from SSL/TLS Status
- • Check if subdomain DNS is pointing correctly
Best Practices
- • Use descriptive subdomain names
- • Keep consistent naming conventions
- • Ensure SSL is enabled for all subdomains
- • Document subdomain purposes for team reference
