title: Add a sudomain for each folder in my userdir path with Apache
body: <p>I activated the userdir mod with apache2 and configure my domain to get the content of the <code>www</code> folder in my home.
  I create a Virtualhost for the main domain which works good.
  But now i would like to automatically add a subdomain for each folder in my <code>/home/user/www/</code></p>
  
  <p>Here is the virtualhost i code, but it redirect all the subdomains to the <code>/home/user/www/</code></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  ServerAdmin webmaster@localhost
  ServerName mysite.com
  ServerAlias *.mysite.com
  
  DocumentRoot /home/user/www/
  
  UseCanonicalName Off
  VirtualDocumentRoot /home/user/www/%1
  
  &lt;Directory /home/user/www/&gt;
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  &lt;/Directory&gt;
  
  ErrorLog /var/log/apache2/error.mysite.log
  LogLevel warn
  
  CustomLog /var/log/apache2.mysite.log combined
  &lt;/VirtualHost&gt;`
  </code></pre>