Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

when I have one domain on a server and maybe two or three subdomains, it is no problem to manually setup a virtual host for each (sub)domain. But when I get more domains each one with more subdomains, it gets to a point where another solution is required...

Best would be some way that doesn't need a restart of Apache whenever a new (sub)domain is configured. But I have never configured another apache than the one on my local computer, had control panels...

Now the time has come to learn something new. Can somebody tell me how I can get my configuration like I want it?


share|improve this question

The only thing I can think of is to have a wildcard vhost: *, then use server side scripts to distinguish between subdomains. Depending upon how different the site content is, this may or may not work-- based on the subdomain you can <?php include(); ?> (or # include depending on the language) different files.

You could definitely run into some caching issues with this, and its not the most robust, but depending on your needs it may work, and it does prevent you from having to modify your apache config for each subdomain.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.