Skip to content

Addon or parked domain shows the wrong site on cPanel

An addon, parked, or subdomain loads the main domain's content or another site's. The document root or DNS is pointing at the wrong place. Here is how to fix the mapping.

When you load an addon domain, a parked domain, or a subdomain and it shows the primary domain’s homepage — or some other site entirely — the domain is resolving to the server but Apache is pointing it at the wrong document root, or DNS is sending it somewhere else. The files for the right site may be perfectly in place; the mapping from hostname to folder is what is wrong. The fix is to reconcile three things for that domain: where DNS points it, what document root cPanel has recorded, and which folder actually holds its files.

What’s happening

On cPanel, several domains share one account and one IP, and Apache uses name-based virtual hosting to decide which document root serves each hostname. Each addon/subdomain has its own DocumentRoot (a subfolder under the account home) and its own ServerName/ServerAlias. The site shows the wrong content when one of those links is broken:

  • The addon domain’s document root points at the primary public_html instead of its own folder (a setup mistake, or the addon folder was deleted and Apache fell back).
  • DNS points the domain at a different server or a parked record, so you never reach this account’s vhost at all — you reach whatever lives at that other IP.
  • The domain is parked on top of the primary rather than added as its own site, so by design it mirrors the main domain.
  • A vhost was not rebuilt after creating the addon (httpd.conf is stale), so Apache still serves the catch-all/default vhost — often the primary site or the first account on the IP.
  • A wildcard or catch-all ServerAlias on another vhost is greedily matching the hostname before the intended vhost.

How to verify

Confirm what document root cPanel has for the domain and that DNS points at this server.

# Document root cPanel recorded for THIS domain
grep -i "<domain>" /etc/userdatadomains
cat /var/cpanel/userdata/<cpaneluser>/<domain> | grep -i documentroot

# Does the hostname resolve to THIS server?
dig +short A <domain>
hostname -I

Check what Apache actually serves for the hostname, and which vhost it matched.

# What does the server return for this exact hostname?
curl -sI -H "Host: <domain>" http://127.0.0.1/ | head -1
curl -s -H "Host: <domain>" http://127.0.0.1/ | head -20

# The vhost block for this domain in the built Apache config
grep -A15 -i "ServerName <domain>" /etc/apache2/conf/httpd.conf

Confirm the right files are in the folder cPanel thinks is the docroot:

ls -la /home/<cpaneluser>/public_html/<addon-folder>/
ls -la /home/<cpaneluser>/<subdomain>/

The fix

  1. Point the document root at the correct folder — the most common cause. If grep documentroot shows the addon pointing at the primary public_html, fix it. In cPanel » Domains, the addon/subdomain’s document root must be its own folder. If the UI does not allow the edit, remove and re-create the addon domain with the correct docroot, then upload the files there.
  2. Fix DNS pointing at the wrong place — dig A <domain> returns an IP that is not this server, so you are reaching a different host entirely (an old server, a parked-domain landing page, a registrar placeholder). Update the A record / nameservers to this server (see the DNS runbook). The content shown is whatever lives at that wrong IP, not a cPanel problem.
  3. Add it as a real domain, not parked — a parked (aliased) domain intentionally shows the primary site. If the domain should have its own content, remove the alias and add it as an addon domain with its own document root. Parked is correct only when you want it to mirror the main site.
  4. Rebuild the Apache vhosts — httpd.conf is stale and Apache is serving the default/catch-all vhost. Run /scripts/rebuildhttpdconf then /scripts/restartsrv_httpd (or WHM » Rebuild HTTP Configuration). This regenerates the vhost for the new domain so Apache stops falling back to the primary or first account on the IP.
  5. Resolve a greedy ServerAlias/wildcard — another vhost has a wildcard ServerAlias * or an alias that matches this hostname first. Find it in httpd.conf and remove or narrow it so the intended vhost wins. Wildcard aliases left from old setups are a classic “all subdomains show one site” cause.
  6. Check for an over-broad redirect — a Redirect/RewriteRule in the primary public_html/.htaccess can catch the addon’s requests if the addon folder lives under public_html. Scope the rule to the primary host only, or move the addon docroot outside the primary docroot.
  7. Confirm the folder actually has the right files — if the docroot is correct but the wrong content still shows, verify the folder is not empty or holding the wrong site’s files (ls -la). An empty docroot can fall through to a parent index in some configurations.

Once DNS, the recorded document root, and the folder contents all name the same site, load the domain and confirm it serves its own homepage — test with curl -H "Host: <domain>" against the server to bypass any stale local DNS, so you know Apache itself is mapping the hostname correctly. Stack Harbor handles cPanel addon-domain and vhost mapping triage under cPanel/WHM management — start a conversation.