On Oct 25, 2010, at 12:07 PM, Matt Price wrote:

ok, I'm trying to understand but I guess I don't quite get it. If I have a file like this:


<VirtualHost *:80>
   DocumentRoot /home/drupal-commons/drupal_commons

   ServerName tdhc.digitalcommons.ca

</VirtualHost>

<VirtualHost *:80>
   UseCanonicalName    Off

   VirtualDocumentRoot /var/www/%0

   Options All

   ServerAdmin [email protected]

   # Store uploads in /var/www/wp-uploads/$0

   RewriteEngine On

   RewriteRule ^/wp-uploads/(.*)$ /var/www/wp-uploads/%{HTTP_HOST}/$1

</VirtualHost>

all traffic, no matter the HOST of the request, gets directed to / home/drupal-commons/drupal_commons. If I reverse the stanzas, no traffic ever gets directed there. Is there no possible ordering in which some traffic is matched by one of the stanzas, and some by another? And if not, is there a better trick to make that work? Thanks very much,

You second vhost lacks a ServerName directive. As such, all traffic goes to the first (default) virtual host.

The solution is to put a ServerName (and possibly one or more ServerAlias directives) in the second VirtualHost.

--
Rich Bowen
[email protected]
http://drbacchus.com/



Reply via email to