Route mapping?

Hi,
I am very new to Ruby on Rails. I am going through some books as
reference. When I was running my app I mistaken place a letter like:
localhost:3000/s and as there was no matching for s in my route.rb I
get this error:
Routing Error

No route matches "/s" with {:method=>:get}

So, my question is that; is there any way or exception to handle such condition?

Any idea regarding this?

yes but be careful, if search engines recieve status 200 for something in you site that does not exist it will be indexed falsely as some thing that exist in you page, so you have to return the correct status.

imagine this:

a search engine looks for some old content in your page, instead of receiving a not found message it will receive a 200 ok status by default is you have a catch all route that says something like “oppsss not found”, it works for a human but search engines will receive an ok and will never remove the old content from the cache.

see how is done here.

http://railscasts.com/episodes/46-catch-all-route

remenber to return the correct status with the redirect

It works. Thanks a lot. That’s what I was looking for.