title: rails subdomain routing (both static and wildcard!)
body: <p>Got a quick question about configuring proper routing for subdomains in <code>routes.rb</code>. I looked around Google and noticed there is not a lot of resources and definitive answers on subdomain routing.</p>
  
  <p>This is the configuration for our application:</p>
  
  <blockquote>
    <ol>
    <li><p>www.domain.com => root_path</p></li>
    <li><p>api.domain.com => api controller</p></li>
    <li><p>admin.domain.com => admin controller</p></li>
    <li><p>*.domain.com => subdomain controller (only allows whitelisted
    domains, ie: sub1.domain.com, sub2.domain.com, sub3.domain.com)</p></li>
    </ol>
  </blockquote>
  
  <p>I imagine it would be constraints for subdomain <code>'www'</code> and <code>'api'</code> and <code>'admin'</code>, but would appreciate any further advice, thanks!!</p>