# Rails way for creating "sorry no page found" for bad urls?

**URL:** <https://www.ruby-forum.com/t/rails-way-for-creating-sorry-no-page-found-for-bad-urls/104847>\
**Category:** Rails\
**Created:** [May 23, 2007, 5:27am UTC](https://www.ruby-forum.com/t/rails-way-for-creating-sorry-no-page-found-for-bad-urls/104847 "2007-05-23T05:27:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [May 23, 2007, 5:27am UTC](https://www.ruby-forum.com/t/rails-way-for-creating-sorry-no-page-found-for-bad-urls/104847/1 "2007-05-23T05:27:56Z")

</div>

hi,  
other than brute forcing my way in creating render =\> ‘no page found’  
for every action that returns a nil variable, is there a rails way to  
creating a no page found for when someone decided to try random urls?

thnaks.

---

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [May 23, 2007, 6:15am UTC](https://www.ruby-forum.com/t/rails-way-for-creating-sorry-no-page-found-for-bad-urls/104847/2 "2007-05-23T06:15:39Z")

</div>

mixplate wrote:

> hi,  
> other than brute forcing my way in creating render =\> ‘no page found’  
> for every action that returns a nil variable, is there a rails way to  
> creating a no page found for when someone decided to try random urls?
> 
> thnaks.

note the 404.html file in the public directory

if you use routes properly it will take care of itself.
