# 404 error in route

**URL:** <https://www.ruby-forum.com/t/404-error-in-route/163743>\
**Category:** Rails\
**Created:** [March 24, 2009, 3:56pm UTC](https://www.ruby-forum.com/t/404-error-in-route/163743 "2009-03-24T15:56:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 24, 2009, 3:56pm UTC](https://www.ruby-forum.com/t/404-error-in-route/163743/1 "2009-03-24T15:56:41Z")

</div>

Hi,

I get a very strang error when I deploy my rails 2.2.2 application to  
the server. The application works when I start it with script/server.  
but when I deploy the app to rails host server (I think it runs with  
lighttpd or something). I can only acess the page with first level URL  
(i.e., [http://test6.123server.cn/users](http://test6.123server.cn/users)). But I can’t access the second  
level URL (i.e., [http://test6.123server.cn/users/1](http://test6.123server.cn/users/1)  
[http://test6.123server.cn/users/new](http://test6.123server.cn/users/new)).  
I get http 404 error which indicate the page can’t be found. I guess  
there is something wrong with the route. But my route is very simple  
(attached below). Anyone had the same problem before? thanks.

## My route.rb file

## ActionController::Routing::Routes.draw do |map| map.resources :users #… map.connect ‘:controller/:action/:id’ map.connect ‘:controller/:action/:id.:format’ end

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 25, 2009, 2:48pm UTC](https://www.ruby-forum.com/t/404-error-in-route/163743/2 "2009-03-25T14:48:44Z")

</div>

Anyone can help on this one? I block on this issue for a about 2 weeks.

2009/3/24 removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 25, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/404-error-in-route/163743/3 "2009-03-25T17:17:48Z")

</div>

On Tue, Mar 24, 2009 at 6:56 AM, removed\_email\_address@domain.invalid  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I get a very strang error when I deploy my rails 2.2.2 application to  
> the server. The application works when I start it with script/server.  
> but when I deploy the app to rails host server (I think it runs with  
> lighttpd or something).

“think”?? not a good sign.

> ```
> I can only acess the page with first level URL
> 
> ```
> 
> (i.e., [http://test6.123server.cn/users](http://test6.123server.cn/users)). But I can’t access the second  
> level URL (i.e., [http://test6.123server.cn/users/1](http://test6.123server.cn/users/1)[http://test6.123server.cn/users/new](http://test6.123server.cn/users/new)).  
> I get http 404 error which indicate the page can’t be found. I guess  
> there is something wrong with the route. But my route is very simple  
> (attached below).

Have you run `rake routes` and compared that to what’s showing up  
in your server access and rails app logs?

## That’s what I’d do for starters 🙂

Hassan S. ------------------------ removed\_email\_address@domain.invalid
