What should I do about this subdomain I want to delete that has an Add On domain linked to it?

RGFuelCells

Member
Oct 18, 2021
13
2
3
College Station
cPanel Access Level
Root Administrator
My requirement is that my organization needs these two domains first.com and second.com and I’m trying to figure out what the best way to have them setup is. The names have been aliased for privacy.

Domain name: first.com

Document root: /public_html/



Domain name: second.com

Document root: /public_html/second




Under Subdomains in our cPanel I found these:

Subdomain name: second.first.com

Document root: /public_html/second


It seems redundant to have second.first.com as a subdomain since we already have it as a domain (internally we think of first.com and second.com as separate websites even though they are on the same server and whoever was working on the website before me set the domains this way). And it appears as people can enter "second.first.com" and enter the same website without an SSL certificate. So, I tried to delete the subdomain: “second.first.com” because it looks to me like it shouldn’t be there because we already have this as a domain: “second.com”.

I tried to delete the subdomain “second.first.com” but I got these error on the next page:

“There was a problem removing the subdomain “second.first.com”. The subdomain “second.first.com” links to the following addon domain “second.com”. You must remove the addon domain before you remove the subdomain."
Would deleting the add on domain ‘second.com’ and then deleting the subdomain first.second.com cause any issues? We do not want first.com and second.com to be impacted.
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,041
111
118
Houston, TX
cPanel Access Level
Root Administrator
Hey there!

From the perspective of the Apache configuration and the VirtualHosts, subdomains and addon domains are the same. There will always be a subdomain associated with an addon domain once it is created. Therefore, the subdoman created cannot be deleted. However, end-users should not be able to navigate to the subdomain If it is not configured at the DNS-level as an A record or CNAME record. You could also secure the subdomain with an SSL and set up a redirect that pushes traffic to your addon domain.

An A record for the subdomain is automatically added within cPanel when the addon domain is created. So, if you use custom nameservers that resolve to your cPanel server, the DNS for this subdomain will be configured by default. In this instance, you could simply delete that A record that gets added automatically.


If you are interested in securing the subdomain with an SSL and then redirecting it to the addon domain, these articles should help.



Please let me know if you have any more questions.