domain based routes?

I want to serve 2 different domains on my rails application, let's say and

When you type in a browser to get one set of routes
inside the rails application (let's say starting with index.html),
when you type to get another set (starting with

A complet isolation would be great, like 2 different routes.rb.

Is this possible? I use nginx and mongrel if is important.


I may found the answer here, take a look:

Let me know if it's working for you...

Guys, the request routing plugin extends routing to support domains
and subdomains (among other things) and I would definitely recommend
it for this. The README and RDoc are quite sufficient. I have used it
in the past to provide things like per-domain theme support.

If you are using a named virtual host there may be some additional
nginx configuration for you to do.


so why it's not working?

map.connect 'index.html', :controller => 'items', :action =>
'list' , :conditions => { :domain => 'second' }

I get:

Valid criteria are strings, regular expressions, true, or nil

my bad, it's working on my local computer, I'll try on the server