Routing every request to same action

Hi,

I have some problem, I want to route every request from URL to an action
in my one controller.
Like if I enter localhost:3000/rac .Here it will take the ‘rac’ as a
controller name and then route it to the ‘index’ action of the ‘rac’
controller. But what I want is that it should redirect towards
:controller=>‘companies’ :action=>‘index’ , doesnt matter that ‘rac’
controller exisits or not, It should just redirect to my desired
controller/action.
I tried this in my routes.rb
map.connect ‘parts/:number’,:controller=>‘companies’ ,
:action=>‘index’
But its not working.
Please help me to overcome this problem,
Thanks in advance,
Regards,
Umair

Try this in your routes.rb

map.connect “*anything”, :controller => “companies”, :action =>
“index”

I tried only a few examples and it seems to work. Though I think you
will need to place this line before the two generic connect commands as
below

map.connect “*anything”, :controller => “companies”, :action =>
“index”
map.connect ‘:controller/:action/:id’
map.connect ‘:controller/:action/:id.:format’

If you are going to route all your requests to companies/index then you
probably don’t need the last two connect commands anyways and can get
rid of them.

-S