Hi there. I use Virtual Hosts on Apache to host multiple sites on one web server and I was wondering if there is some kind of failsafe/default mechanism available. Basically, say for example I have one website set up as a Virtual Host like

<Virtual Host *:80>
    ServerAdmin foo@bar.com
    ServerName bar.com
    ServerAlias bar.com
    ServerAlias www.bar.com
    DocumentRoot /var/www/bar.com/public_html/
    ...
</VirtualHost>

Is there any way of setting up so that any domains that don't match any websites in my vhost.conf, fall back to a failsafe/default Virtual Host. I want to do this so I can point a load of domains at this webserver and have them all use the same Virtual Host, so I can use .htaccess to redirect them all to a single website (Without having to list each and every domain in the vhost.conf file).

I've had a good look through the documents on the Apache site and this:
http://httpd.apache.org/docs/2.2/vhosts/examples.html#default
Seems like it could be of use but I thought I would ask and make sure.

Cheers

Anyone got any suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.