4

I would like to use the the subdomain as my DocumentRoot folder

foo.example.com 

Goes to

/var/www/foo

However I do not want to add a new entry for every subdomain

Basically

*.example.com

Goes to

/var/www/*

Where * is any alphanum string

Botto
  • 231
  • 1
  • 10

1 Answers1

6

VirtualDocumentRoot should do it.

<VirtualHost *:80>
    ServerName placeholdername
    ServerAlias *.example.com
    VirtualDocumentRoot /var/www/%1
</VirtualHost>
Shane Madden
  • 114,520
  • 13
  • 181
  • 251