8 Friday evening I put together a tiny [Apache2](http://httpd.apache.org) module
9 simliar to mod_vhost_alias or mod_vd.
10 [mod_domaintree](http://cvs.iworks.at/co.php/mod_domaintree/mod_domaintree.c)
11 maps host names to a filesystem tree. While mod_vhost_alias and mod_vd seem to
12 be more flexible, they seem less useful to me.
14 mod_vhost_alias lets you define very precisely which part of the host name
15 maps to which directory but adds odd underscores if the part (number) of the
16 hostname does not exist.
18 mod_vd lets you define the numerical amount of host name parts to strip.
20 But I **don't want to strip always** one part of the host name like "www" \- I
21 just want to strip the first part of the host name (i.e. www) if it occurs in
24 If you want to try it out, there's nothing more to do then (w)getting
25 [it](http://cvs.iworks.at/co.php/mod_domaintree/mod_domaintree.c?p=1) and
28 sudo /usr/sbin/apxs2 -a -i -c mod_domaintree.c
30 ## Sample Configuration:
35 DomainTreePrefix /sites
36 DomainTreeSuffix /html
39 ### Mapped Hosts: (accepting "www" as prefix if DomainTreeStripWWW is enabled)
48 ### Resulting Filesystem Tree:
69 PS: I was very suprised how easy it is to build a simple module for Apache (if
70 you have some templates to look at though). :)