Subdomains

    Create subsections of your website with subdomains for better organization

    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.com

    Blog section

    shop.yoursite.com

    Online store

    support.yoursite.com

    Help desk

    portal.yoursite.com

    Customer 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

    1. Log in to cPanel
    2. Navigate to "Domains" section
    3. 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

    1. Find subdomain in the list
    2. Click "Manage" or edit icon
    3. Change document root if needed
    4. Click "Change"

    Remove Subdomain

    1. Find subdomain in list
    2. Click "Remove"
    3. 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