A domain or subdomain opens the wrong site: the document root and how to check it

The short answer: each domain and subdomain on a hosting account points to a folder (the “document root”) and shows what is in that folder. If one shows another’s site, nearly always the folder is the wrong one, or the domain is an alias of the main one by design. It is fixed in two minutes, in cPanel.

The most common causes

What you see The cause What to do
The new domain shows the main domain’s site It was created as an alias (parked) instead of an addon domain, or its folder is the same as the main one. See Parked domains. If you want a different site, create it as an addon domain with its own folder: How to add another domain or a subdomain.
The subdomain opens a file list or a site that is not its own The subdomain’s folder is empty or points to another. Check the document root and where the files are: Where your website files go.
After changing DNS, you see the old site DNS has not arrived yet, or your computer keeps the old answer. How long DNS changes take and Checking DNS.
The domain shows the server’s welcome page The domain reached the server but has no folder of its own, or the site has not been uploaded yet. How to remove this welcome page.
It shows the right site but with another domain’s address in the links WordPress is configured with the old address. Changing the WordPress site address.
A redirect leads to the main domain There is a rule in the folder’s .htaccess, or a redirect plugin. Look at that folder’s .htaccess file and cPanel’s redirects.

Check and fix

1 In cPanel, open “Domains”. Each domain and subdomain shows its document root.
2 Compare with what you expected. Domain B should have its own folder (for example, public_html/domain-b.com), not A’s.
3 Correct the document root (the Domains screen lets you edit it) or move the files to the right folder.
4 Clear the cache of the browser, the cache plugin and Cloudflare, if you use it: Clearing the cache.
Take a copy before moving files. Moving the wrong folder can delete the site that is live. See Your own backup.

Checked the document root and it still opens the wrong site? Open a ticket with the two domains.

Open a support ticket

SEE ALSO

Where your website files go: public_html, folders and which domain uses which

Parked domains (aliases): the same site on more than one name

How to add another domain or a subdomain

Checking DNS from the command line: dig and nslookup, and how to read the answer

RECOMMENDED PRODUCT

Register your .com domain

Secure your company name before someone else registers it. from $17.00/yr

Search a domain
  • 0 Users Found This Useful
Was this answer helpful?