Ali
Ali

Reputation: 2042

Why sub-domain accessible through the main domain?

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

Answers (1)

anubhava
anubhava

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

Related Questions