Apache Virtual Host Matching Problem

Ok, I've been fighting this for two days, time to look for some help.

FreeBSD 5.4
Apache 2.0.54

I have a single IP. I'm setting up a mass virtual hosting environment according to the httpd.apache.org docs. However, I also have two named virtual hosts that need special treatment. I have set up what I think should work but it isn't. Here's what I have:

Code:
NameVirtualHost *:80
<VirtualHost *:80>
  VirtualDocumentRoot /usr/local/www/data/vhosts/%2+
</VirtualHost>

<VirtualHost *:80>
  ServerName www.domain.com
  DocumentRoot /usr/local/www/data
</VirtualHost>

<VirtualHost *:80>
  ServerName ipm.domain.com
  DocumentRoot /usr/local/www/platmap/htdocs
</VirtualHost>
The way I understand it Apache should match the most specific host, if there is no direct match it will use the first VirtualHost directive as the "default". However everything is matching the first block. If I move the first block to the end then the two named VirtualHosts work fine but all other domains match to the first named Virtual Host. (?)

I'm dying here. Any help would be appreciated.

 

 

 

 

Top