title: Domain and subdomain wildcards on Apache as dynamic subfolders
body: <p>I'm creating website builder like <code>weebly</code> and <code>wix</code> format. I would like to dynamic subfolders. For example:</p>
  
  <pre><code>domain.com        /public_html/sites/domain.com/
  
  sub1.root.com     /public_html/sites/sub1/
  
  test.com          /public_html/sites/test.com/
  
  sub2.root.com     /public_html/sites/sub2/
  </code></pre>
  
  <p>I can do only <code>static</code> with following and forced me to add one by one whole websites.</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot "/public_html/sites/domain.com"
      ServerName domain.com
      ServerAlias *.domain.com
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>How can i do dynamic both domains that client owner and subdomains that i'll give user.</p>