# Trapping or rewriting crappy urls

**URL:** <https://www.ruby-forum.com/t/trapping-or-rewriting-crappy-urls/162557>\
**Category:** Rails\
**Created:** [March 11, 2009, 10:53am UTC](https://www.ruby-forum.com/t/trapping-or-rewriting-crappy-urls/162557 "2009-03-11T10:53:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [March 11, 2009, 10:53am UTC](https://www.ruby-forum.com/t/trapping-or-rewriting-crappy-urls/162557/1 "2009-03-11T10:53:51Z")

</div>

Hi,

Sometimes in my log, I see correct urls that have been appended with  
some crap characters and that currently raises an internal server error  
which I don’t really care about. What would be the cleanest way to deal  
with such situation? Use a begin…rescue?
