Forum Moderators: phranque

Message Too Old, No Replies

Pointing Two Domains To The Same Virtual Host

         

dimo414

5:56 am on Sep 10, 2008 (gmt 0)

10+ Year Member



I have a series of websites setup as virtual hosts on an Apache install, and I want these sites to respond to multiple domain names. I do not want to redirect one domain to another, I want the Virtual Host directive to fire if it receives either ServerName.

I've tried:
<VirtualHost *>
DocumentRoot /www/site/
ServerName site.mine.com
ServerName site.ours.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /www/site/
ServerName site.mine.com site.ours.com
</VirtualHost>
and
<VirtualHost *>
DocumentRoot /www/site/
ServerName site.*
</VirtualHost>

None of which have worked. Is this even possible, or can it only be done by two separate VirtualHost directives?

Also, I do not care about page rank for these sites, so don't tell me about how this will/could damage my rank.

jdMorgan

1:36 pm on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use ServerAlias in the same vhost container, or copy the existing vhost container and change the Servername.

See Apache core directives documentation, and the virtual hosting configuration tutorials at apache.org.

Jim

dimo414

8:42 pm on Sep 10, 2008 (gmt 0)

10+ Year Member



Thank you, that worked perfectly!