Hah... didn't think you could put a * in the ServerAlias... haven't found any documentation to that effect. But I'll try this.

And Nicholas, I haven't had a chance to try your solution yet, but I appreciate it. Thanks to everyone who tried to help. I can probably get one of these to work.

b

Michael Stewart (vericgar) wrote:
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)

--
[email protected] mailing list

Reply via email to