0

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

This works fine. However, if I manually insert a prefix such as "www" to make the URL look like "http://www.subdomain.clientsite.com" 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.

2 Answers 2

1

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: http://www-01.ibm.com/software/webservers/httpservers/doc/v1326/manual/vhosts/name-based.html

0

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

subdomain.example.com. 251 IN A 10.9.8.7

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

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

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.something.com$ [NC]
RewriteRule ^(.*)$ http://something.com/$1 [R=301,L]

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .