Ben Munat wrote: > Hello. Does anyone know how I can configure apache 2.0.x to map all > requests to a given subdomain to a give directory regardless of the rest > of the server name? > > Doing this for my webmail setup... so mail.foo.com, mail.bar.com, > mail.baz.com, etc. should all map to my squirrelmail directory. > > I've been doing this by adding virtual host directives for the mail > subdomain for every domain I add but it seems like there should be an > easier way. I figure I can probably do it with mod_rewrite but I'm no > wizard with that. > > thanks, > > b
If I understand you right, you want mail.* to point to say /var/www/mail
, while letting other domains/subdomains point to their own places.
Here's how I handle it on my server:
<VirtualHost *:80>
ServerName mail.your-domain.com
ServerAlias mail.*
DocumentRoot /var/www/mail
[... other configuration as needed ...]
</VirtualHost>
This needs to be one of the first virtual hosts that apache reads so
that it matches mail.* before it matches say *.blahblah.com (if you are
hosting blahblah.com)
--
Michael Stewart [EMAIL PROTECTED]
Gentoo Developer http://dev.gentoo.org/~vericgar
GnuPG Key ID 0x08614788 available on http://pgp.mit.edu
--
signature.asc
Description: OpenPGP digital signature
