I have web site hosted on shared hosting account which is managed by CPanel. It allows to create unlimited sub-domains. I have the following situation:
Suppose that my primary domain there is: mydomain.com My account's files are found on the hosting server at /home/myaccount/public_html I decided to make sub-domain named dir i.e dir.mydomain.com I created this sub-domain to use the following file: /home/myaccount/public_html/Hosts/directory
Now I, successfully, able to access http://dir.mydomain.com However, I need to prevent the access http://mydomain.com/Hosts/directory and exclusively restrict the access to the sub-domain.
How could I achieve this using .htaccess?
The following is a copy of the code I use in the .htaccess file found in /home/myaccount/public_html/Hosts/directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
AddType audio/mpeg mp3
AddType text/xml xml