Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to setup an specific environment for my hostings, but don't know what's the best approach.

I want have a domain called

* The www. should contain the main website (hosting site)
* every subdomain ex. needs to be redirected to a subfolder

I don't know what is the best approach. Having an virtualhost for every customer or having one virtualhost for the service and redirect using mod_rewrite? I'm currently setting up this environment local, so if you have an good idea plase don't forget to mention the hosts file.

Everything should be automatically generated and on the fly included.

Kind regards, Ward

share|improve this question

Seems like you're looking for mod_vhost_alias.

share|improve this answer
are there other options instead putting it in database ? – Ward Jul 4 '10 at 14:04
mod_vhost_alias doesn't use any database. – joschi Jul 4 '10 at 14:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.