Why is a subdomain created when I add an addon domain?

Due to how cPanel is designed, creating an addon domain also requires a corresponding subdomain to be created. There is no way to avoid creating a subdomain, but you can hide URLs if desired (subdomain.mydoman.com and mydomain.com/subdomain).

To do so, you can choose to redirect both links to a Not Found page using the .htaccess rule

Enter the following rules in the .htaccess file stored in your addon domain’s web root directory:

<IfModule mod_rewrite.c>

 RewriteEngine On 

 RewriteCond %{HTTP_HOST} subdomain.mydomain.com$ 

 RewriteRule ^(.*)$ "http://mydomain.com/404" [R=301,L] 


Be sure to update the rules to correspond with your domain name and addon.

Alternatively, you can point subdomain.mydomain.com and www.subdomain.maindomain.com to a non-working IP address. For example,

1) First, log in to your HostPapa Dashboard


2) Click My cPanel


3) Scroll to the Domains section and select Zone Editor.


4) Click Manage to list the DNS zones associated with your account.


5) Scroll down the list of records and click the Edit button next to the subdomain you wish to hide.


6) Update the IP address and click the Save Record button to complete the configuration.


If you need help with your HostPapa account, please open a support ticket from your dashboard.

Related Articles