www.data-blogger.com
www.data-blogger.com

Reputation: 4164

Dynamic Virtual Hosts

How can I make this dynamic? So that it is usable for every 'user' and website. (For example

<VirtualHost server-ip:80>
  ServerName user.website.nl
  DocumentRoot /var/wwww/user/website.nl
  ...

So for example kevin.website.nl will display the content from /var/www/kevin/website.nl. And when /var/www/kevin/test.com/ exists, then when I visit kevin.test.com it will display the content in that directory. Or if user 'thomas' exists and /var/www/thomas/abc.com/ exists and we visit thomas.abc.com, it will load from that directory.

Upvotes: 0

Views: 1744

Answers (1)

The easiest way to do this is probably using mod_vhost_alias.

You can also do this with the environment variables of mod_rewrite I believe. You'll need to use a trick to do this though.

Upvotes: 1

Related Questions