Why is a Subdomain created when adding an Addon domain?

Whenever adding a addon domain to cPanel, a subdomain will be created automatically. The subdomain is required for the addon to work properly and should not be removed.

 

Unfortunately there is no option in cPanel to disable the subdomain as this is the fundamental principle of cPanel architecture, but you can hide this links.

 

One way is to add the following code to the .htaccess file of the addon domain's public folder.

<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{HTTP_HOST} sub.domain.com$ 
RewriteRule ^(.*)$ "http://domain.com/" [R=301,L] 
</IfModule>

The code will redirect all traffic from sub.domain.com to your addon domain.

 

Alternatively you might want to make the subdomain fully unavailable. To do so, just point the subdomain to eg. 127.0.0.1 in the DNS zone using the cPanel DNS manager/zone editor.

 

Please note that changes made to the DNS zone can take up to 48 hours to propagate.

 

  • domain, subdomain, addon
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Adjust the PHP maximum upload size

This article describes how to change the maximum upload size limit for your PHP applications in...

How to log in and log out of cPanel

This article describes how to log in and log out of cPanel so you can manage your GigaCloud...

How to change your cPanel password

This article describes how to change your cPanel password. This password enables you to log in to...

How to manage MySQL databases and users in cPanel

How to manage MySQL databases and users in cPanel This article describes how to use cPanel to...

How do I change my PHP versions?

We currently offer support for PHP versions 5.2 through 7.3. We recommend using at least PHP 7.1...

Powered by WHMCompleteSolution