# Hot to: use routes to url rewrite

**URL:** <https://www.ruby-forum.com/t/hot-to-use-routes-to-url-rewrite/91341>\
**Category:** Rails\
**Created:** [April 7, 2007, 3:10am UTC](https://www.ruby-forum.com/t/hot-to-use-routes-to-url-rewrite/91341 "2007-04-07T03:10:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [April 7, 2007, 3:10am UTC](https://www.ruby-forum.com/t/hot-to-use-routes-to-url-rewrite/91341/1 "2007-04-07T03:10:04Z")

</div>

I’m sending a url via email so a user can activate their account.

Like so:  
[http://domain.com/confirm\_email/f039a41a580735384c7e1e2deb379901e79981a7](http://domain.com/confirm_email/f039a41a580735384c7e1e2deb379901e79981a7)

This should map to a method in controller ‘login’, with the action  
‘confirm\_email’ which expects the param ‘code’.

I configured my routes file like so:

map.connect ‘confirm\_email/:code’, :controller =\> ‘login’, :action =\>  
‘confirm\_email’

But when I hit that url I get a 404, with no activity in the log file.  
It’s not even making it to the action (or controller).

I’m not sure where I’ve gone wrong in my understanding of routes.

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [April 7, 2007, 3:15am UTC](https://www.ruby-forum.com/t/hot-to-use-routes-to-url-rewrite/91341/2 "2007-04-07T03:15:29Z")

</div>

NEVERMIND ;O

I was testing locally and forgot to reset my hosts file. Doh!
