1. Home
  2. Hosting Management
  3. cPanel
  4. Domains
  5. How to Hide the Subdomain Created by cPanel for Addon Domains?

How to Hide the Subdomain Created by cPanel for Addon Domains?

You have probably noticed already that each addon domain you create in cPanel, comes with a designated subdomain. Unfortunately, there is no way to avoid the creation of the subdomain, but you can hide URL if you want to make sure that none of your visitors will know that your website is an addon domain.

As an example, if the main domain is chemicloud.com and the addon domain is webhosting.com, the automatically created subdomain will be webhosting.chemicloud.com.

To hide the subdomain, you can choose to redirect the subdomain to a Not Found page, using .htaccess rule so any visitor that will visit webhosting.chemicloud.com will get a 404 Not Found page.

To do this, 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} webhosting.chemicloud.com$ 
RewriteRule ^(.*)$ "https://chemicloud.com/404" [R=301,L] 
</IfModule>

Please make sure to update the above rules to correspond with your domain name and addon domain.

Alternatively, you can achieve similar results by simply pointing the subdomain A record to a non-working IP address – something like 1.1.1.1. If you want to find out on how to manage your DNS with cPanel, just check this article.

If you notice any problems or if you need any help, please do not hesitate to contact at any time by opening a ticket from your client area or in LiveChat – we are 24/7 online!

Updated on July 19, 2019

Was this article helpful?

Related Articles

Need help?
We're always here for you. Submit a ticket or Chat with a live person.
Submit Ticket