Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

issue: misoncifgured dns?

symptom: when i visit http://www.borisnikolaev.com/index.php?option=com_content&view=article&id=51&Itemid=53, it shows what should be on http://www.floridaseating.com/index.php?option=com_content&view=article&id=51&Itemid=53

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: http://i.imgur.com/ITx4F.png

secondary domain dns configuration: http://i.imgur.com/vknWN.png

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/domain.com/conf

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

1 Answer 1

up vote 1 down vote accepted

So:

$ host borisnikolaev.com
borisnikolaev.com has address 216.70.99.158

$ host www.borisnikolaev.com
www.borisnikolaev.com has address 216.70.99.158

I assume you mean to serve www.borisnikolaev.com and borisnikolaev.com 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 www.floridaseating.com by default.

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

ServerAlias www.borisnikolaev.com
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: wiki.mediatemple.net/w/… –  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 www.example.com servername. –  cjc Mar 13 '12 at 20:40
add comment

Your Answer

 
discard

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.