1 |
Hah... didn't think you could put a * in the ServerAlias... haven't |
2 |
found any documentation to that effect. But I'll try this. |
3 |
|
4 |
And Nicholas, I haven't had a chance to try your solution yet, but I |
5 |
appreciate it. Thanks to everyone who tried to help. I can probably get |
6 |
one of these to work. |
7 |
|
8 |
b |
9 |
|
10 |
Michael Stewart (vericgar) wrote: |
11 |
> Ben Munat wrote: |
12 |
>> Hello. Does anyone know how I can configure apache 2.0.x to map all |
13 |
>> requests to a given subdomain to a give directory regardless of the rest |
14 |
>> of the server name? |
15 |
>> |
16 |
>> Doing this for my webmail setup... so mail.foo.com, mail.bar.com, |
17 |
>> mail.baz.com, etc. should all map to my squirrelmail directory. |
18 |
>> |
19 |
>> I've been doing this by adding virtual host directives for the mail |
20 |
>> subdomain for every domain I add but it seems like there should be an |
21 |
>> easier way. I figure I can probably do it with mod_rewrite but I'm no |
22 |
>> wizard with that. |
23 |
>> |
24 |
>> thanks, |
25 |
>> |
26 |
>> b |
27 |
> |
28 |
> If I understand you right, you want mail.* to point to say /var/www/mail |
29 |
> , while letting other domains/subdomains point to their own places. |
30 |
> |
31 |
> Here's how I handle it on my server: |
32 |
> |
33 |
> <VirtualHost *:80> |
34 |
> ServerName mail.your-domain.com |
35 |
> ServerAlias mail.* |
36 |
> DocumentRoot /var/www/mail |
37 |
> [... other configuration as needed ...] |
38 |
> </VirtualHost> |
39 |
> |
40 |
> This needs to be one of the first virtual hosts that apache reads so |
41 |
> that it matches mail.* before it matches say *.blahblah.com (if you are |
42 |
> hosting blahblah.com) |
43 |
> |
44 |
-- |
45 |
gentoo-server@g.o mailing list |