ShahiLanding

How to Set Up a Custom Domain

This step-by-step tutorial shows you how to use your own custom domain (like landing.yourbrand.com) for your landing pages.

What You’ll Learn

By the end of this tutorial, you’ll know how to:

    1. Set up a subdomain for landing pages
    2. Configure DNS settings
    3. Map domain in WordPress
    4. Use custom domains per landing page
    5. Set up SSL certificates
    6. Troubleshoot domain issues
    7. Time Required: 15-30 minutes
      Difficulty: Intermediate
      Prerequisites: Access to domain registrar/DNS settings

      Why Use Custom Domains?

      Benefits

    8. 🎨 Professional branding: promo.yourbrand.com vs yoursite.com/landing/promo
    9. πŸ“Š Better tracking: Separate analytics per subdomain
    10. πŸ”— Clean URLs: Short, memorable links
    11. πŸš€ Multiple campaigns: Different subdomains for different campaigns
    12. πŸ”’ Improved trust: Custom domain = more professional
    13. πŸ“ˆ SEO: Better link structure
    14. Common Use Cases

      `
      Main site: yourcompany.com
      Landing pages: pages.yourcompany.com
      Promotions: promo.yourcompany.com
      Events: events.yourcompany.com
      Localized: us.yourcompany.com, uk.yourcompany.com
      Campaigns: launch.yourcompany.com
      `

      Method 1: Subdomain for All Landing Pages

      Map a subdomain (e.g., pages.yourbrand.com) to all ShahiLandin pages.

      Step 1: Create Subdomain in cPanel

    15. Log into your cPanel (or hosting control panel)
    16. Find Domains section
    17. Click Subdomains
    18. Enter subdomain: pages
    19. Select root domain: yourbrand.com
    20. Document root: Same as main WordPress installation
    21. Click Create
    22. Result: pages.yourbrand.com β†’ /public_html (same as yoursite.com)

      Step 2: Update DNS (If External DNS)

      If using external DNS (Cloudflare, Route53):

    23. Log into DNS provider
    24. Add A Record:
    25. `
      Type: A
      Name: pages
      Value: 123.45.67.89 (your server IP)
      TTL: 3600
      `

    26. Save changes
    27. Wait 5-60 minutes for propagation
    28. Step 3: Configure in WordPress

      Edit wp-config.php:

      `php
      // Add before “That’s all, stop editing!”

      // Allow multiple domains
      define(‘WP_SITEURL’, ‘https://yourbrand.com’);
      define(‘WP_HOME’, ‘https://yourbrand.com’);

      // Handle subdomain requests
      if (isset($SERVER[‘HTTPHOST’]) && $SERVER[‘HTTPHOST’] === ‘pages.yourbrand.com’) {
      define(‘WP_SITEURL’, ‘https://pages.yourbrand.com’);
      define(‘WP_HOME’, ‘https://pages.yourbrand.com’);
      }
      `

      Step 4: Update .htaccess

      Add to .htaccess (Apache):

      `apache

      Handle subdomain

      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^pages\.yourbrand\.com$ [NC]
      RewriteRule ^(.*)$ https://pages.yourbrand.com/$1 [L,R=301]
      `

      Step 5: Configure ShahiLandin

    29. Go to ShahiLandin β†’ Settings
    30. Click Advanced tab
    31. Find Custom Domain section
    32. Enter domain: pages.yourbrand.com
    33. Check Use for all landing pages
    34. Click Save Changes
    35. Step 6: Test

      Visit: https://pages.yourbrand.com/your-landing-page/

      Should display your landing page.

      Method 2: Custom Domain Per Landing Page

      Assign different domains to individual pages.

      Step 1: Enable Custom Domains Feature

    36. ShahiLandin β†’ Settings β†’ Advanced
    37. Find Per-Page Custom Domains
    38. Check Enable custom domain mapping
    39. Save Changes
    40. Step 2: Create Subdomain

      Same as Method 1, Step 1:

    41. Create subdomain: promo.yourbrand.com
    42. Point to WordPress directory
    43. Step 3: Add DNS Record

      Add A record for promo.yourbrand.com β†’ your server IP

      Step 4: Map Domain to Landing Page

    44. Edit your landing page
    45. Scroll to Custom Domain meta box (right sidebar)
    46. Enter: promo.yourbrand.com
    47. Click Update
    48. Step 5: Configure Server (Apache)

      Add to .htaccess:

      `apache

      Domain mapping for landing pages

      RewriteEngine On

      Promo subdomain β†’ specific landing page

      RewriteCond %{HTTP_HOST} ^promo\.yourbrand\.com$ [NC]
      RewriteRule ^(.*)$ /landing/your-landing-page/ [L,QSA]
      `

      Step 6: Configure Server (Nginx)

      Add to nginx config:

      `nginx
      server {
      listen 80;
      server_name promo.yourbrand.com;

      location / {
      rewrite ^/(.*)$ /landing/your-landing-page/$1 break;
      try_files $uri $uri/ /index.php?$args;
      }
      }
      `

      Step 7: Test

      Visit: https://promo.yourbrand.com

      Should display your specific landing page.

      Method 3: Completely Separate Domain

      Use entirely different domain (e.g., specialoffer.com) for a landing page.

      Step 1: Register Domain

      Purchase domain from:

    49. GoDaddy
    50. Namecheap
    51. Google Domains
    52. Cloudflare Registrar
    53. Step 2: Point Domain to Your Server

      In domain registrar’s DNS settings:

      Option A: A Record (Point to server IP)
      `
      Type: A
      Host: @
      Value: 123.45.67.89 (your server IP)
      `

      Option B: CNAME (Point to existing domain)
      `
      Type: CNAME
      Host: @
      Value: yourbrand.com
      `

      Step 3: Add to Server Configuration

      For cPanel/WHM:

    54. WHM β†’ Account Functions β†’ Create a New Account
    55. OR: Addon Domains β†’ Add specialoffer.com
    56. Point to WordPress directory
    57. For Apache Virtual Host:

      `apache

      ServerName specialoffer.com
      ServerAlias www.specialoffer.com
      DocumentRoot /var/www/yoursite


      AllowOverride All


      `

      For Nginx:

      `nginx
      server {
      listen 80;
      server_name specialoffer.com www.specialoffer.com;
      root /var/www/yoursite;

      location / {
      try_files $uri $uri/ /index.php?$args;
      }
      }
      `

      Step 4: WordPress Configuration

      Edit wp-config.php:

      `php
      // Handle external domain
      $host = $SERVER[‘HTTPHOST’];

      if ($host === ‘specialoffer.com’ || $host === ‘www.specialoffer.com’) {
      define(‘WP_SITEURL’, ‘https://specialoffer.com’);
      define(‘WP_HOME’, ‘https://specialoffer.com’);
      }
      `

      Step 5: Map in ShahiLandin

    58. Edit landing page
    59. Custom Domain meta box
    60. Enter: specialoffer.com
    61. Choose redirect behavior: Display page at this domain
    62. Update
    63. Step 6: Redirect to Landing Page

      Add to .htaccess or server config:

      `apache

      Redirect root domain to specific landing page

      RewriteCond %{HTTP_HOST} ^(www\.)?specialoffer\.com$ [NC]
      RewriteRule ^$ /landing/special-offer-page/ [L]
      `

      Setting Up SSL/HTTPS

      Option 1: Let’s Encrypt (Free)

      cPanel AutoSSL:

    64. cPanel β†’ SSL/TLS Status
    65. Find pages.yourbrand.com
    66. Click Run AutoSSL
    67. Wait 2-5 minutes
    68. Certificate installed automatically
    69. Certbot (Command Line):

      `bash

      Install Certbot

      sudo apt-get install certbot python3-certbot-apache

      Get certificate

      sudo certbot –apache -d pages.yourbrand.com

      Auto-renewal (cron)

      sudo certbot renew –dry-run
      `

      For Multiple Subdomains:

      `bash
      sudo certbot –apache -d pages.yourbrand.com -d promo.yourbrand.com -d launch.yourbrand.com
      `

      Option 2: Cloudflare (Free & Easy)

    70. Add site to Cloudflare
    71. Update nameservers at domain registrar
    72. SSL automatically provisioned
    73. Settings β†’ SSL/TLS β†’ Full (strict)
    74. Option 3: Purchased SSL Certificate

    75. Purchase from SSL provider (Sectigo, DigiCert, etc.)
    76. Generate CSR on server
    77. Upload certificate files to cPanel or server
    78. Install via cPanel β†’ SSL/TLS or manually in Apache/Nginx config
    79. Force HTTPS

      Add to .htaccess:

      `apache

      Force HTTPS

      RewriteEngine On
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://%{HTTPHOST}%{REQUESTURI} [L,R=301]
      `

      Or in ShahiLandin:

    80. Settings β†’ Advanced β†’ Force HTTPS β†’ βœ…
    81. Domain Mapping Plugins

      Alternative approach using plugins.

      WordPress MU Domain Mapping

      For WordPress Multisite:

    82. Install WordPress MU Domain Mapping
    83. Network Admin β†’ Settings β†’ Domain Mapping
    84. Configure server IP
    85. Map domains to sites
    86. Domain Mapping System (Premium)

      ShahiLandin Pro includes built-in domain mapper:

    87. Settings β†’ Domain Mapping
    88. Add domain: promo.yourbrand.com
    89. Select landing page from dropdown
    90. Save
    91. Automatic DNS configuration (if integrated with Cloudflare)
    92. Wildcard Subdomains

      Allow any subdomain to work (e.g., *.yourbrand.com).

      Step 1: DNS Wildcard Record

      Add to DNS:

      `
      Type: A
      Host: *
      Value: 123.45.67.89 (server IP)
      `

      Now any subdomain (test.yourbrand.com, demo.yourbrand.com) points to your server.

      Step 2: Server Configuration

      Apache:

      `apache

      ServerName yourbrand.com
      ServerAlias *.yourbrand.com
      DocumentRoot /var/www/yoursite

      `

      Nginx:

      `nginx
      server {
      listen 80;
      server_name yourbrand.com *.yourbrand.com;
      root /var/www/yoursite;
      }
      `

      Step 3: Dynamic Routing in ShahiLandin

      Edit functions.php or use Code Snippets:

      `php
      addaction(‘templateredirect’, function() {
      $host = $SERVER[‘HTTPHOST’];

      // Extract subdomain
      preg_match(‘/^([^\.]+)\.yourbrand\.com$/’, $host, $matches);

      if (!empty($matches[1])) {
      $subdomain = $matches[1];

      // Find landing page by slug matching subdomain
      $page = getpagebypath($subdomain, OBJECT, ‘shahilanding’);

      if ($page) {
      // Load this landing page
      global $post;
      $post = $page;
      setup_postdata($post);

      include gettemplatedirectory() . ‘/single-shahi-landing.php’;
      exit;
      }
      }
      });
      `

      Now:

    93. promo.yourbrand.com β†’ loads landing page with slug “promo”
    94. launch.yourbrand.com β†’ loads landing page with slug “launch”
    95. Tracking Custom Domains

      Google Analytics Setup

      Track each subdomain separately:

    96. Create property for each subdomain:
    97. – Property 1: yourbrand.com
      – Property 2: pages.yourbrand.com
      – Property 3: promo.yourbrand.com

    98. Or use single property with filters:
    99. – All Website Data view
      – Filter by hostname

      UTM Parameters

      Add to links pointing to custom domains:

      `
      https://promo.yourbrand.com/?utmsource=email&utmcampaign=spring_sale
      `

      Track in ShahiLandin analytics automatically.

      Troubleshooting

      “Domain Not Resolving”

      Check DNS propagation:
      `bash

      Check if DNS updated

      nslookup pages.yourbrand.com

      Or use online tool

      https://dnschecker.org
      `

      Wait: DNS can take 24-48 hours to propagate globally.

      “ERRTOOMANY_REDIRECTS”

      Cause: Redirect loop (HTTP β†’ HTTPS β†’ HTTP)

      Solution:
      Check .htaccess for conflicting rules, or:

      `apache

      Remove existing redirects, add this

      RewriteEngine On
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
      `

      “SSL Certificate Invalid”

      Cause: Certificate doesn’t cover subdomain

      Solution:

    100. Get new certificate including subdomain
    101. Or use wildcard certificate (*.yourbrand.com)
    102. “WordPress Mixed Content Warnings”

      Cause: Some assets loading over HTTP

      Solution:
      `php
      // wp-config.php
      if (isset($SERVER[‘HTTPXFORWARDEDPROTO’]) && $SERVER[‘HTTPXFORWARDEDPROTO’] === ‘https’) {
      $_SERVER[‘HTTPS’] = ‘on’;
      }
      `

      Or use plugin: Really Simple SSL

      “Landing Page Shows Main Site”

      Cause: Server not configured to handle subdomain

      Solution:

    103. Check server configuration (Apache/Nginx)
    104. Ensure subdomain points to correct directory
    105. Verify .htaccess rewrite rules
    106. Best Practices

      Subdomain Naming

      βœ… Good:

    107. pages.yourbrand.com (clear purpose)
    108. promo.yourbrand.com (campaign type)
    109. launch.yourbrand.com (event name)
    110. us.yourbrand.com (geographic)
    111. ❌ Bad:

    112. asdf.yourbrand.com (meaningless)
    113. temp.yourbrand.com (sounds temporary)
    114. test123.yourbrand.com (unprofessional)
    115. Security

    116. βœ… Always use HTTPS (SSL certificate)
    117. βœ… Keep DNS records private when possible
    118. βœ… Use strong passwords for domain registrar account
    119. βœ… Enable 2FA on domain registrar
    120. βœ… Lock domain to prevent unauthorized transfers
    121. Performance

    122. Use CDN (Cloudflare) for DNS
    123. Enable HTTP/2
    124. Set proper cache headers
    125. Use same server for all subdomains (avoid additional DNS lookups)
    126. Summary

      You’ve learned how to:

    127. βœ… Set up subdomain for all landing pages
    128. βœ… Map custom domain to individual landing pages
    129. βœ… Use completely separate domains
    130. βœ… Configure DNS and server settings
    131. βœ… Install SSL certificates
    132. βœ… Set up wildcard subdomains
    133. βœ… Track custom domains in analytics
    134. βœ… Troubleshoot common domain issues
    135. Your landing pages now have professional custom domains!

      Related Tutorials

    136. How to Create Your First Landing Page
    137. How to Set Up Conversion Tracking
    138. Settings & Configuration

Need Help? See documentation or contact support.

Share this article

Was this article helpful?

Help us improve our documentation

Still need help?

Our support team is ready to assist you with personalized guidance for your workspace.

Submit a support ticket