Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cybix

macrumors 6502a
Original poster
Feb 10, 2006
993
1
Western Australia
I want to have multiple domain names go to one site, wonder if I can do it with the 'serveralias' directive?

eg:

Code:
<VirtualHost *>
    ServerAdmin joe@bloggs.com
    DocumentRoot /var/www/bloggs
    ServerName www.bloggs.com.au
    ServerAlias bloggs.com.au bloggs.com
    ErrorLog logs/www.bloggs.com.au-error_log
    CustomLog logs/www.bloggs.com.au-access_log common
</VirtualHost>

With the above ServerAlias directive, can I specify multiple names on the one line, I want "bloggs.com.au and "bloggs.com" to basically work just like "www.bloggs.com.au"

Am I on the right track, or do I have to specify multiple ServerAlias directives within this virtual host like this:

Code:
<VirtualHost some.ip.address>
    ServerAdmin joe@bloggs.com
    DocumentRoot /var/www/bloggs
    ServerName www.bloggs.com.au
    ServerAlias bloggs.com.au
    ServerAlias bloggs.com
    ErrorLog logs/www.bloggs.com.au-error_log
    CustomLog logs/www.bloggs.com.au-access_log common
</VirtualHost>

I'm guessing that this one, will bug out, as you cant have a directive twice in a virtual host?

Thanks in advance!
 
I have just checked the documentation in apache.org. (assuming you are using at least v1.3), it does allow multiple domain delimited by spaces
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.