Topic: map lighttpd to a specific controller action?

I asked this one on the mailing list but no hits..

I have a multi-city application set up and right now the city is set by
a session variable:

            if @user.city.to_s=='3'
                 session[:city]="nyc"
                redirect_to(:controller => "users", :action => "nycindex")

Is it possible to map a specific URL to that same action? e.g.
ny.foo.com would set @user.city.to_s == '3' and so head over to the
users/nycindex page?

Can that be done in lighttpd or is there another way to do it?

Thanks..

Re: map lighttpd to a specific controller action?

Use the account_location plugin, or an adaptation of that pattern. DHH himself wrote it, and the annotations in the source code are pretty clear.