Hey all -
I've got a CentOS 5.2 server running Apache 2 and a menagerie of other packages. I'll try to make this quick:
- Server running Apache configured to load a variety of virtualhost configuration file in a /etc/httpd/conf/vhost folder. It loads all the virtual host files just fine and all the websites appear (subdomains and otherwise).
If a user browses something like 'nodomainexists.domainname.com' into a browser url bar, you're taken to the site whose vhost file was created last. I would much rather have users who attempt to use invalid subdomains to be forwarded to a specific virtualhost file (that runs the main website/frontend). How would I go about making sure that all non-existant subdomains get routed to a specific virtualhost?
last.domain.com exists (vhost file was created last)
not.domain.com doesn't exist (no vhost file, etc)
does exist (has vhost file, valid site)
When a user goes to not.domain.com, they'll get last.domain.com instead of being sent to www.domain.com
How would I go about making the www.domain.com
a catch all for bad and/or misspelled subdomains?
Thanks in advance!