We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,539 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Apache - Virtual hosts

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

1
Contributor
1
Reply
1 Day
Discussion Span
8 Months Ago
Last Updated
2
Views
bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

Anyone got any suggestions?

bops
Posting Whiz in Training
273 posts since Aug 2005
Reputation Points: 24
Solved Threads: 14
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0984 seconds using 2.65MB