Issue:
I have two sub-domains: $domain.com and $2nddomain.com
I'm able to get to them both if I use my primary domain first, like this: www.$domain.com and www.$domain.com/$2nddomain.com
I thought sub-domains could be reached by just using the sub-domain name as in $domain.com and $2nddomain.com?
Possible Cause:
First, let's figure out what a subdomain and an add-on domain are.
An addon domain links a new domain name to a directory in your web hosting account.
It then stores its files in that directory.
Let's say you have added an addon domain named "addon.com" to your hosting account via Domains >>> Addon Domains.
You can view this domain in any of these locations below:
- addon.com
- addon.$example.com
- $example.com/addon
A subdomain is a different thing altogether.
A subdomain is a subsection of your website that sometimes exists as a sub-directory of your public_html (document root) directory or your account's home directory.
Subdomains use a prefix in conjunction with the domain name and can be viewed at:
- subdomain.$example.com
However, you can redirect either of these options to a different domain by using the "Redirects To" or "Modify the Redirects" options.
Also, remember that it is not enough to add these to your hosting account.
You need to have the necessary DNS records in place for these to resolve properly.
We recommend editing the records first (A and NS records) first.
Then wait until the changes have properly propagated before attempting to add an addon domain.
Our current name-servers are:
- ns1.mydnsnode.com
- ns2.mydnsnode.com
- ns3.mydnsnode.com
- ns4.mydnsnode.com
For a subdomain, once created, ensure that the records are in place at your DNS providers or domain registrar.
Solution:
Remove $2nddomain.com as a sub-domain and add it either as an addon domain or using the "Create a New Domain" option at cPanel >>> Domains.
Then either create a new domain by entering the new domain name.
For example, $example.com.
Or create a subdomain by entering a new name followed by a period (.) and then the website’s domain.
For example, enter subdomain.example.com to create a subdomain of example.com.
Recommended URLs:
https://dashboard.webhostingmagic.com/knowledgebase/28/How-To-Create-A-Subdomain-In-cPanel.html
https://dashboard.webhostingmagic.com/knowledgebase/41/How-To-Host-Additional-Domains-You-Own-To-cPanel.html
https://dashboard.webhostingmagic.com/knowledgebase/31/How-To-Create-A-New-Addon-Domain-In-cPanel.html
https://dashboard.webhostingmagic.com/knowledgebase/202/How-To-Use-cPanel-Domain-Interface-To-Add-Domains.html
https://dashboard.webhostingmagic.com/knowledgebase/77/How-To-Redirect-A-Domain-Or-Website-To-A-New-One.html