Reputation: 2042
I have a web server with DirectAdmin installed, every time I create a new sub-domain (e.g xyz.domain.com) it will also accessible through the main domian (e.g domian.com/xyz)!!!
Any ideas on how to disable the access of sub-domain from the main domain?
Upvotes: 1
Views: 50
Reputation: 784868
how to disable the access of sub-domain from the main domain?
You can place this rule as the very first rule in /xyz/.htaccess
:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^xyz\. [NC]
RewriteRule ^ - [F]
Upvotes: 2