# Routs question

**URL:** <https://www.ruby-forum.com/t/routs-question/168885>\
**Category:** Rails\
**Created:** [May 27, 2009, 1:37am UTC](https://www.ruby-forum.com/t/routs-question/168885 "2009-05-27T01:37:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![staypufd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Post date:** [May 27, 2009, 1:37am UTC](https://www.ruby-forum.com/t/routs-question/168885/1 "2009-05-27T01:37:07Z")

</div>

I would like to redirect a user to the index page if they type in a  
page that does not exist on my site. How do I go about that?

---

<div class="post-metadata">

**Author:** ![staypufd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Post date:** [May 27, 2009, 3:13am UTC](https://www.ruby-forum.com/t/routs-question/168885/2 "2009-05-27T03:13:34Z")

</div>

Sam G. wrote:

> I would like to redirect a user to the index page if they type in a  
> page that does not exist on my site. How do I go about that?

The following as your last route, will catch any other requests that  
don’t match any other routes.

map.blanket\_route ‘\*path’, :controller =\> ‘whatever’, :action =\>  
‘some\_action’

Hope that helps.

Darrik

–  
Darrik Mazey  
DarmaSoft, LLC.  
1627 Marigold Avenue  
Akron, Ohio 44301-2627  
office: 330.983.9941  
fax: 330.983.9942  
mobile: 330.808.2025  
removed\_email\_address@domain.invalid

To obtain my public key, send an email to  
removed\_email\_address@domain.invalid.
