Question

I have my domain name point all subdomains to a server:

domain.com client.domain.com

I am trying to think of a vhost configuration that would automatically take the first part of the sub domain and set this folder as the document root, for example:

client.domain.com => /path/to/vhost/domain.com/client

client2.domain.com => /path/to/vhost/domain.com/client2

etc.

Does anyone know if this is possible?

Thanks,

Ian

Was it helpful?

Solution

Have a look at http://httpd.apache.org/docs/2.0/misc/rewriteguide.html - and specifically at the Virtual User Hosts example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top