views:

10

answers:

0

I want to create an Apache directive that will be based on a domain (say eli.lh) and that every sub-domain entered (such as test.eli.lh) will be directed to a sub-folder of a predefined directory with the same name as the sub-domain.

What I mean:

I have /var/projects/ that contains any number of directories inside it, one of them is /var/projects/test/. When someone goes to test.eli.lh apache will go to /var/projects/ search for directory /test and if it finds it, it will be served as that domain, if not, than throw a 404 error or whatever...

All that without creating dedicated server aliases for each and every sub-domain/directory pairs.

Is it possible?