title: Apache Multiple VirtualDocumentRoot
body: <p>Using Apache2 on a Linux system is there a way to have multiple VirtualDocumentRoot using <a href="http://httpd.apache.org/docs/2.0/mod/mod_vhost_alias.html" rel="noreferrer">mod_vhost_alias</a>?</p>
  
  <p>This is naming convention I am currently using and would like to continue to use:</p>
  
  <pre><code>host                    directory
  127.0.0.1 domain        domain.com
  127.0.0.1 sub.domain    domain.com_sub
  </code></pre>
  
  <p>Then in my vhosts section of the httpd.conf I have:</p>
  
  <pre><code>NameVirtualHost 127.0.0.1
  
  &lt;VirtualHost 127.0.0.1&gt;
      VirtualDocumentRoot /var/www/%0.0.com
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost 127.0.0.1&gt;
      VirtualDocumentRoot /var/www/%2.0.com_%1
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>The problem with this is when I visit sub.domain the Apache error log shows that it is looking for /var/www/sub.domain.com rather than /var/www/domain.com_test which leads me to believe it only reads the first rule and then fails, but what I would like it to do is use any document root that satisfies either of the two VirtualDocumentRoot rules.</p>