# Basic Routes

**URL:** <https://www.ruby-forum.com/t/basic-routes/125866>\
**Category:** Rails\
**Created:** [January 13, 2008, 2:10am UTC](https://www.ruby-forum.com/t/basic-routes/125866 "2008-01-13T02:10:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 13, 2008, 2:10am UTC](https://www.ruby-forum.com/t/basic-routes/125866/1 "2008-01-13T02:10:19Z")

</div>

I am trying to replace the default homepage (public/index.html) to one  
of my controllers.

I deleted the file in ‘public/index.html’ created a controller called  
‘site’ and added this line to my ‘routes.rb’ file…

map.connect ‘’, :controller =\> ‘site’, :action =\> ‘index’

But when I go to my root URL ‘[http://staging.mysite.com](http://staging.mysite.com)’ I get a 404  
error. I tested my controller by going to ‘[http://staging.mysite.com/](http://staging.mysite.com/)  
site’ and ‘[http://staging.mysite.com/site/index](http://staging.mysite.com/site/index)’ and it works fine,  
and displays the correct page.

Any ideas why the routing isn’t working? This seems like this is very  
basic, and should be a piece of cake.

-Adam D.

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 13, 2008, 2:31am UTC](https://www.ruby-forum.com/t/basic-routes/125866/2 "2008-01-13T02:31:21Z")

</div>

It was working all along. I didn’t realize you have to restart the  
application after every change.

-Adam D.

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 13, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/basic-routes/125866/3 "2008-01-13T22:52:39Z")

</div>

On Jan 12, 5:30 pm, “Adam D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It was working all along. I didn’t realize you have to restart the  
> application after every change.

You don’t have to restart the server after every change, but you do  
have to restart if you change routing.

///ark
