Topic: routes question

It looks like my lighttpd server crashed yesterday.  The only thing I found of interest is that the last request in my production log was from somebody looking for a URL that doesn't exist in my app.  I should probably fix it with routes, right?  Can somebody help me understand how to route all 404 errors back to the index page?

Also, where can I put a rescue for 'Recognition failed for "/comment.php" errors?


Re: routes question

You can do a catch-all URL if none of your other routes match.

map.catch_all '*url', :controller => 'foo', :action => 'bar'

Put that in routes.rb as your last route and set the appropriate controller/action that you want to display.

vinnie - rails forum admin