Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

issue: misoncifgured dns?

symptom: when i visit, it shows what should be on

if i remove the 'www' subdomain, it works as usual.

this occurs for several of the other domains on this server, and when using any subdomain, except those in the dns zone file (excluding www).

the reason i noticed this is because google had indexed several of the pages under the wrong domain name.

primary domain dns configuration:

secondary domain dns configuration:

any help is appreciated!

i have a dv server with mediatmeple, which has apache 2.2, and plesk 10.4. i have switched off the dns management in plesk, as i don't resell hosting, and manage that through mediatemple's account center page.

FOUND SOLUTION, thanks to direction by @cjc

Following should work. Add to vhost.conf file typically found in /var/www/vhosts/

ServerAlias *
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.* [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com
RewriteCond /var/www/vhosts/ -d
RewriteRule ^(.*) /%1/$1 [L]
share|improve this question

1 Answer 1

up vote 1 down vote accepted


$ host has address

$ host has address

I assume you mean to serve and from the same web server, given the DNS.

In that case, your Apache virthosts aren't configured to respond properly to the www versions of the server names, and are hitting the configuration for by default.

In the virthost config for, use the ServerAlias directive and add a line like:

share|improve this answer
shouldn't this be automatically be done by plesk? not sure if it makes a difference, but i am also using suPHP. – vulgarbulgar Mar 13 '12 at 20:15
updated the question to include the solution which seems to be working. hopefully it's the correct configuration. found the answer in the mediatemple wiki:… – vulgarbulgar Mar 13 '12 at 20:29
I have not idea: I've never used Plesk. Anyway, your code looks good, and will bounce requests over to the servername. – cjc Mar 13 '12 at 20:40

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.