I am using the following .htaccess
file to prevent access to a add-on domain through my host monster account. However the folders/files can still be accessed by going to my domain.com/domains/addon-domain.
I have edited the file extensively, trying different things and taking bits from here and there but it just isn't working. If anyone has any experience with this, especially how HostMonster do it, that'd be great.
# Use PHP54CGI as default
AddHandler fcgid54-script .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/domains/addon-domain1/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/domains/addon-domain2/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/domains/addon-domain3/(.*)$
RewriteRule ^(.*)$ - [L,R=404]
You need to move that rule so that it's before your wordpress rule. you can also probably consolidate some of the conditions: