Apache Default/Catch-All Virtual Host?
Posted
by
SJaguar13
on Server Fault
See other posts from Server Fault
or by SJaguar13
Published on 2009-11-06T18:36:58Z
Indexed on
2012/03/26
23:31 UTC
Read the original article
Hit count: 237
apache2
|virtualhost
If I have 3 domains, domain1.com, domain2.com, and domain3.com, is it possible to set up a default virtual host to domains not listed? For example, if I would have:
<VirtualHost 192.168.1.2 204.255.176.199>
DocumentRoot /www/docs/domain1
ServerName domain1
ServerAlias host
</VirtualHost>
<VirtualHost 192.168.1.2 204.255.176.199>
DocumentRoot /www/docs/domain2
ServerName domain2
ServerAlias host
</VirtualHost>
<VirtualHost 192.168.1.2 204.255.176.199>
DocumentRoot /www/docs/everythingelse
ServerName *
ServerAlias host
</VirtualHost>
If you register a domain and point it to my server, it would default to everythingelse showing the same as domain3. Is that possible?
© Server Fault or respective owner