Hello:
An addon domain can be accessed via the addon domain itself, it's sub-folder on the primary domain, or the subdomain off the primary domain. You can prevent this by doing the following:
To prevent access to the sub-domain go to the Cpanel>subdomains:
Under the stepup Redirect option, select the subdomain which will be in the format:
addon.primary.com and click Setup redirect. In the next window you'll put the address to the addon domain (
www.addon.com). This will take care of the sub-domain part.
To prevent access to the sub-folder you will need to add some lines to your .htaccess file in the public_html folder. They are:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?primary\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/addon [NC]
RewriteRule ^addon/(.*)$ http://www\.addon\.com/$1 [R,L]
I hope this helps.