Put this in the .htaccess file located at the subdomains folder
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.primarydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdomain.primarydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^addondomain.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.addondomain.com/ [R=301,L]
Keywords: addon domain sub domain rewrite block htaccess