Page 1 of 1

multidomain domain2.com to www.domain1.com

Posted: Wed Jun 24, 2009 6:58 pm
by Peter_w
Hi,

I have the following problem:
I have Apache on linux hosting several domains.

When I go the domain with http://www.domain2.com everything is OK.
But when i do http://domain2.com i get redirected to http://www.domain1.com,
domain1.com is my main domain.

The domains are all on 1 IP address and they are pointing to it, so I don't think it is a DNS problem.

Anyone get any idea?

Re: multidomain domain2.com to www.domain1.com

Posted: Wed Jun 24, 2009 8:58 pm
by chris
It might be a setting in your apache config for virtual hosts.

It should look something like this.

Code: Select all

<VirtualHost *:80>
ServerName www.domain1.com
ServerAlias domain1.com web.domain1.com
DocumentRoot /var/www/domain1.com
</VirtualHost>
Make sure you have ServerAlias set.

To be sure, you should post you config.

Code: Select all

/etc/httpd/httpd.conf
or

Code: Select all

/etc/apache2/httpd.conf
and
/etc/apache2/sites-enabled/{virtualhost.conf}
Depending on which flavor of linux you have.

Re: multidomain domain2.com to www.domain1.com

Posted: Sun Jun 28, 2009 7:00 pm
by Peter_w
Thanks, that did the trick.

Any idea how I can direct all the sub domains to www?