www disappear when using Name-based virtual host.

Posted by Tianzhou Chen on Stack Overflow See other posts from Stack Overflow or by Tianzhou Chen
Published on 2010-06-11T15:49:59Z Indexed on 2010/06/11 15:52 UTC
Read the original article Hit count: 222

Filed under:
|

Below is my config file

NameVirtualHost 12.34.56.78:80

ServerAdmin [email protected] ServerName domain1.com ServerAlias www.domain1.com DocumentRoot /srv/www/domain1.com/public_html1/ ErrorLog /srv/www/domain1.com/logs/error.log CustomLog /srv/www/domain1.com/logs/access.log combined

ServerAdmin [email protected] ServerName domain2.com ServerAlias www.domain2.com DocumentRoot /srv/www/domain2.com/public_html1/ ErrorLog /srv/www/domain2.com/logs/error.log CustomLog /srv/www/domain2.com/logs/access.log combined

The thing is when I put www.domain1.com into browser, it will be automatically changed to domain1.com. However, if I put www.domain2.com, the address remains the same. I don't know why this happens. BTW, I haven't put .htaccess file under their document root.

Thanks for your advice!

Tianzhou

© Stack Overflow or respective owner

Related posts about apache2

Related posts about virtualhost