WordPress Blog Setup for CommercePad

WordPress Blog Setup via Softaculous (cPanel)

Main Domain: domain.com
Blog URL: www.domain.com/blog/
Subdomain: blog.domain.com

1. Add DNS Record for Subdomain

Before doing anything in cPanel, make sure the subdomain points to your hosting server:

  • Go to your DNS Zone Manager (domain registrar or cPanel β†’ Zone Editor).
  • Add an A Record:
    • Name: blog.domain.com
    • Type: A
    • Value: your hosting server’s IP Address

πŸ‘‰ After propagation, blog.domain.com will point to your hosting account.

2. Create Subdomain in cPanel

    1. Log in to cPanel.
    2. Go to Domains β†’ Subdomains.
    3. Create a subdomain:
      • Subdomain: blog.domain.com
      • Root Directory: public_html

    πŸ‘‰ This ensures blog.domain.com points to your hosting root.

    3. Install WordPress Using Softaculous

    1. In cPanel, go to Softaculous Apps Installer β†’ WordPress.
    2. Click Install Now.
    3. Choose settings:
      • Choose Domain: select your main domain domain.com (not the subdomain).
      • In Directory: enter blog
        (this means WordPress will be installed in public_html/blog).
    4. Fill out site details, admin user, password, and email.
    5. Click Install.

    βœ” WordPress is now installed at domain.com/blog.

    4. Update WordPress URLs

    Once installation finishes:

    1. Log in to WordPress Dashboard β†’ Settings β†’ General. Or You can update via database in wp-options table
    2. Update:
      • WordPress Address (URL): https://www.domain.com/blog
      • Site Address (URL): https://www.domain.com/blog
    3. Save changes.

    5. Replace .htaccess in Root (public_html)

    Go to public_html/.htaccess and replace with:

    6. Modify wp-blog-header.php in /blog

    Open public_html/blog/wp-blog-header.php and replace with:

    This code is for custom redirect logic: Ensures all traffic goes to https://www.domain.com/blog

    βœ… Final Behavior

    • domain.com/blog β†’ 301 redirect β†’ www.domain.com/blog
    • blog.domain.com β†’ 301 redirect β†’ www.domain.com/blog
    • www.domain.com/blog β†’ βœ… Blog loads correctly

    Hire a professional

    Get matched with a professional who can help you reach your site goals.