RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/addonfolder/(.*)$
RewriteRule ^(.*)$ - [L,R=404]
The example rewrite rules will force
'http://www.domain.com/addonfolder/' and any of its contents to report the "404 Not Found" error.
Be sure to replace the 'domain.com' in the example with your hosting account's main domain address and 'addonfolder' with the name of the folder for your Addon domain.
This can also be applied to multiple Addon domain folders through the use of the [OR] option as in the following example in which 3 Addon folders are being reported as "404 Not Found" when accessed through the main domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/addon1/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon2/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon3/(.*)$
RewriteRule ^(.*)$ - [L,R=404]
Keywords: .htaccess addon domain name primary secondary directory folders hidden inaccessible not accessible