When creating an addon domain in cPanel a few different entry points are created to that addon domain such as subdomain.domain.com and domain.com/subdomain. In many cases it is a good idea to make these additional entry points not accessible. You can do this 2 different ways.
1. Through .htaccess. Add the following code to the .htaccess in your public_html folder.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} subdomain.domain.com$
RewriteRule ^(.*)$ "http://domain.com/404" [R=301,L]
</IfModule>
2. In your Advanced DNS Editor point the sub-domains subdomain.domain.com and www.subdomain.domain.com to a domain that is not valid such as 1.2.3.4.
As always if you have questions or need help don't hesitate to contact our fanatical support!
- 0 utilizatori au considerat informația utilă
Articole similare
Enabling Mysql Remote Access
Opening up Mysql to remote connections is a security risk and so we grant remote access only by...
Using Cron Jobs
Using cPanel Cron JobsCron jobs simply are bash commands put on a schedule. So when looking to...
PHP Selector Supported Versions
We currently offer PHP 5.6, 5.7, 7.0, and 7.1 VIA the PHP Selector in cpanel. All earlier...
Addon Domain | Sorry, the domain is already pointed to an IP address
If when trying to add a addon domain via cPanel you receive an error similar to this:Sorry, the...
cPanel Access Ports Are Blocked By My ISP
It does happen that a ISP (Internet Service Provider) or the place at which you work may have...
