I wish to use Rails 3's new subdomain features to deal with all subdomain pathways except world wide web and nil.

Oppositely inside a second rails application, I wish to exclusively handle world wide web and nil within the url path.

An amount my two VirtualHost records seem like for Apache with Passenger? As well as in the code, for that first subdomain handling application, as long as I handle the brand new uncovered :subdomain constraint in routes correctly to disregard world wide web and nil, which should prevent any conflict right?

Thank you for any input.

Appears like a ServerFault question.

NameVirtualHost *:80

# handles www.mydomain.com and mydomain.com
<VirtualHost *:80>
  ServerName mydomain.com
  ServerAlias www.mydomain.com
  DocumentRoot /data/website1/public
  <Directory /data/website1/public>
    Allow from all
    Options -Multiviews
  </Directory>
</VirtualHost>

# handles *.mydomain.com
<VirtualHost *:80>
  ServerName anything.mydomain.com
  ServerAlias *.mydomain.com
  DocumentRoot /data/website2/public
  <Directory /data/website2/public>
    Allow from all
    Options -Multiviews
  </Directory>
</VirtualHost>