Based on the question I think you don't understand the difference between
</Directory> are used to enclose a group of directives that will apply only to the named directory, sub-directories of that directory, and the files within the respective directories.
</VirtualHost> are used to enclose a group of directives that will apply only to a particular virtual host. Any directive that is allowed in a virtual host context may be used. When the server receives a request for a document on a particular virtual host, it uses the configuration directives enclosed in the
<Directory> directive doesn't control "Directory type URLs". The
DocumentRoot and the
Alias directives controls where in the file system the content is found. Those directives can be used directly in the server config or inside a
For what you are trying to achieve you simply need two
<VirtualHost>s with different
Now, you have both
http://example.com/ for the same website. If the sites aren't all under the same file system directory, you'd need to use
Alias "/examplecom" "/home/user/sites/example.com"