Question: I'm trying to re-route the root path based on the sub-domain request. I had browsed through few articles which mentioned 'constraints' in the routes for rails 3, as mentioned below

```
MyKillerApp::Application.routes.draw do |map|  
  resources :comments  
  resources :articles  
  resources :blogs
  constraints(Subdomain) do  
    match '/' => 'blogs#show'
  end
  root :to => "blogs#index"  
end

```

In `lib/subdomain.rb`

```
class Subdomain  
  def self.matches?(request)  
    request.subdomain.present? && request.subdomain != 'www'  
  end  
end

```

can the same be achieved in rails 2.3 ....?

Answer: 
```
I came around the problem using the subdomain-fu gem. Thanks for the help.... :-)

```
No, router constraints was a new feature in Rails 3.