I have the following VirtualHost section:
UseCanonicalName Off NameVirtualHost *:80 <VirtualHost *:80> VirtualDocumentRoot /sites/%0/httpdocs/ ##VirtualDocumentRoot /sites/%-2/httpdocs/ #VirtualDocumentRoot /sites/%-2.0.%-1/httpdocs/ ##VirtualDocumentRoot /sites/%3+/httpdocs/ <Directory /> Order Allow,Deny Allow from all </Directory> RewriteLog "/etc/httpd/logs/rewrite_log" RewriteLogLevel 0 </VirtualHost>
And my directory structure as
What I want to do is have the example.com work with and without www.
You can see the VirtualDocumentRoot settings I have tried with interpolation. The ## means I had zero success. The # I had minor success with but then none of my other sites will come up. I get
Not Found The requested URL / was not found on this server.
I feel I am doing something wrong. But I cannot see it. The first question is, how do I make this work? Next, is it possible to see which folder exactly the VirtualDocumentRoot is trying to open?