Why is a subdomain create when adding a 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.

Please feel free to get in touch if you have any further questions.

  • cpanel, addon, domain
  • 9 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...