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:
- Set up a subdomain for landing pages
- Configure DNS settings
- Map domain in WordPress
- Use custom domains per landing page
- Set up SSL certificates
- Troubleshoot domain issues
- π¨ Professional branding:
promo.yourbrand.comvsyoursite.com/landing/promo - π Better tracking: Separate analytics per subdomain
- π Clean URLs: Short, memorable links
- π Multiple campaigns: Different subdomains for different campaigns
- π Improved trust: Custom domain = more professional
- π SEO: Better link structure
- Log into your cPanel (or hosting control panel)
- Find Domains section
- Click Subdomains
- Enter subdomain:
pages - Select root domain:
yourbrand.com - Document root: Same as main WordPress installation
- Click Create
- Log into DNS provider
- Add A Record:
- Save changes
- Wait 5-60 minutes for propagation
- Go to ShahiLandin β Settings
- Click Advanced tab
- Find Custom Domain section
- Enter domain:
pages.yourbrand.com - Check Use for all landing pages
- Click Save Changes
- ShahiLandin β Settings β Advanced
- Find Per-Page Custom Domains
- Check Enable custom domain mapping
- Save Changes
- Create subdomain:
promo.yourbrand.com - Point to WordPress directory
- Edit your landing page
- Scroll to Custom Domain meta box (right sidebar)
- Enter:
promo.yourbrand.com - Click Update
- GoDaddy
- Namecheap
- Google Domains
- Cloudflare Registrar
- WHM β Account Functions β Create a New Account
- OR: Addon Domains β Add
specialoffer.com - Point to WordPress directory
- Edit landing page
- Custom Domain meta box
- Enter:
specialoffer.com - Choose redirect behavior: Display page at this domain
- Update
- cPanel β SSL/TLS Status
- Find
pages.yourbrand.com - Click Run AutoSSL
- Wait 2-5 minutes
- Certificate installed automatically
- Add site to Cloudflare
- Update nameservers at domain registrar
- SSL automatically provisioned
- Settings β SSL/TLS β Full (strict)
- Purchase from SSL provider (Sectigo, DigiCert, etc.)
- Generate CSR on server
- Upload certificate files to cPanel or server
- Install via cPanel β SSL/TLS or manually in Apache/Nginx config
- Settings β Advanced β Force HTTPS β β
- Install WordPress MU Domain Mapping
- Network Admin β Settings β Domain Mapping
- Configure server IP
- Map domains to sites
- Settings β Domain Mapping
- Add domain:
promo.yourbrand.com - Select landing page from dropdown
- Save
- Automatic DNS configuration (if integrated with Cloudflare)
promo.yourbrand.comβ loads landing page with slug “promo”launch.yourbrand.comβ loads landing page with slug “launch”- Create property for each subdomain:
- Or use single property with filters:
- Get new certificate including subdomain
- Or use wildcard certificate (
*.yourbrand.com) - Check server configuration (Apache/Nginx)
- Ensure subdomain points to correct directory
- Verify
.htaccessrewrite rules pages.yourbrand.com(clear purpose)promo.yourbrand.com(campaign type)launch.yourbrand.com(event name)us.yourbrand.com(geographic)asdf.yourbrand.com(meaningless)temp.yourbrand.com(sounds temporary)test123.yourbrand.com(unprofessional)- β Always use HTTPS (SSL certificate)
- β Keep DNS records private when possible
- β Use strong passwords for domain registrar account
- β Enable 2FA on domain registrar
- β Lock domain to prevent unauthorized transfers
- Use CDN (Cloudflare) for DNS
- Enable HTTP/2
- Set proper cache headers
- Use same server for all subdomains (avoid additional DNS lookups)
- β Set up subdomain for all landing pages
- β Map custom domain to individual landing pages
- β Use completely separate domains
- β Configure DNS and server settings
- β Install SSL certificates
- β Set up wildcard subdomains
- β Track custom domains in analytics
- β Troubleshoot common domain issues
- How to Create Your First Landing Page
- How to Set Up Conversion Tracking
- Settings & Configuration
Time Required: 15-30 minutes
Difficulty: Intermediate
Prerequisites: Access to domain registrar/DNS settings
Why Use Custom Domains?
Benefits
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
Result: pages.yourbrand.com β /public_html (same as yoursite.com)
Step 2: Update DNS (If External DNS)
If using external DNS (Cloudflare, Route53):
`
Type: A
Name: pages
Value: 123.45.67.89 (your server IP)
TTL: 3600
`
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
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
Step 2: Create Subdomain
Same as Method 1, Step 1:
Step 3: Add DNS Record
Add A record for promo.yourbrand.com β your server IP
Step 4: Map Domain to Landing Page
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:
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:
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
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:
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)
Option 3: Purchased SSL Certificate
Force HTTPS
Add to .htaccess:
`apache
Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTPHOST}%{REQUESTURI} [L,R=301]
`
Or in ShahiLandin:
Domain Mapping Plugins
Alternative approach using plugins.
WordPress MU Domain Mapping
For WordPress Multisite:
Domain Mapping System (Premium)
ShahiLandin Pro includes built-in domain mapper:
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:
Tracking Custom Domains
Google Analytics Setup
Track each subdomain separately:
– Property 1: yourbrand.com
– Property 2: pages.yourbrand.com
– Property 3: promo.yourbrand.com
– 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:
“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:
Best Practices
Subdomain Naming
β Good:
β Bad:
Security
Performance
Summary
You’ve learned how to:
Your landing pages now have professional custom domains!
Related Tutorials
—
Need Help? See documentation or contact support.
Share this article
Still need help?
Our support team is ready to assist you with personalized guidance for your workspace.