0

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: https://i.stack.imgur.com/1HooV.png

secondary domain dns configuration: https://i.stack.imgur.com/fAQV8.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]
vulgarbulgar
  • 739
  • 1
  • 8
  • 14

1 Answers1

1

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
cjc
  • 24,916
  • 3
  • 51
  • 70
  • 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: http://wiki.mediatemple.net/w/(dv):Setup_WordPress_network_with_subdomains – 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