Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Several of my clients created an "A" record to point a sub domain of their site to my server. E.g., points to my IP address.

This works fine. However, if I manually insert a prefix such as "www" to make the URL look like "" it resolves to my website instead of the client's site. I can add anything besides "www" as a prefix.

What is the best way to disable a "sub-subdomain"? It seems like it would be possible to do via the vHost file for each client or perhaps through an .htacess command. However, I don't know the best way to proceed.

Thanks for your thoughts.

share|improve this question

Not sure why this problem occurs, though it is only for certain clients so it could depend on how a web host handles "A" records.

In any event, I added the following line to a vHost file for one of my clients:

ServerAlias subdomain.clientsite.tld *.subdomain.clientsite.tld

and it seemed to do the trick. Got the idea from this link:

share|improve this answer

I can see how a client might have an A record of the form: 251 IN A

I don't see why automatically resolves to the same IP, unless you have a CNAME for each subdomain. But then you say that behaves this way, so I don't understand what you have set up.

It is not uncommon to use a rewrite rule to redirect to - for example in Apache, you would do something like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

This will have the effect of sending traffic from to, which is quite often done in the interests of search engine optimization.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.