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

Recently I started Multi Sites on my VPS which is having Centos 64 bit. Currently I am having two sites live and each is working fine,

Now the problem is in the URL I have the following sites:

http://mbas.co.in

http://u-k.in

mbas was the very first site on my VPS

Now in URL if I type http://mbas.co.in or http://www.mbas.co.in both redirect to my mbas website But for the second website, If in URL I type http://u-k.in then it redirects to the u-k website correctly but if I type http://www.u-k.in then it redirects me to mbas website.

You can try that

I have configured my DNS in this way, see the image http://i55.tinypic.com/14vlpxl.jpg

And my Multi Site code is this

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/www.mbas.co.in
    ServerName mbas.co.in
    ErrorLog logs/mbas.co.in-error_log
    CustomLog logs/mbas.co.in-access_log common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/u-k.in
    ServerName u-k.in
    ErrorLog logs/u-k-error_log
    CustomLog logs/u-k-access_log common
</VirtualHost>
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Add ServerAlias(The ServerAlias directive sets the alternate names for a host, for use with name-based virtual hosts):

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/u-k.in
    ServerName u-k.in
    ServerAlias www.u-k.in
    ErrorLog logs/u-k-error_log
    CustomLog logs/u-k-access_log common
</VirtualHost>

then reload apache2.

share|improve this answer
    
hey thanks mate, such an easy one I couldn't find, really thanks –  ntechi Feb 18 '11 at 6:24
    
@ntechi if the answer is correct, then confirmed it –  ooshro Feb 18 '11 at 6:30
    
yes I was doing it, but it was popping out, you can mark this answer after 5 mins –  ntechi Feb 18 '11 at 6:36

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.