# App at root domain

**URL:** <https://www.ruby-forum.com/t/app-at-root-domain/62939>\
**Category:** Rails\
**Created:** [June 9, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/app-at-root-domain/62939 "2006-06-09T19:18:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweatje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@sweatje](https://www.ruby-forum.com/u/sweatje)\
**Post date:** [June 9, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/app-at-root-domain/62939/1 "2006-06-09T19:18:31Z")

</div>

I have my app up and running at [www.domainname.com/controller/](http://www.domainname.com/controller/) … but  
need to get it set up at just [www.domainname.com](http://www.domainname.com)

I see that by default, rails is loading the pre-made index file in the  
/public dir. How can I override this without changing any directories  
around in my app?

Thanks!  
-stirman

---

<div class="post-metadata">

**Author:** ![sweatje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@sweatje](https://www.ruby-forum.com/u/sweatje)\
**Post date:** [June 9, 2006, 7:34pm UTC](https://www.ruby-forum.com/t/app-at-root-domain/62939/2 "2006-06-09T19:34:07Z")

</div>

Check config/routes.rb

There’s a commented line in there that shows how to do this.

–  
– Tom M.

---

<div class="post-metadata">

**Author:** ![sweatje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@sweatje](https://www.ruby-forum.com/u/sweatje)\
**Post date:** [June 9, 2006, 7:40pm UTC](https://www.ruby-forum.com/t/app-at-root-domain/62939/3 "2006-06-09T19:40:38Z")

</div>

Hey,

First off, you need to remove the public/index.html file.

Then in config/routes.rb

map.connect ‘’, :controller =\> ‘your\_main\_controller’, :action =\>  
‘probably\_index’

Note, the first arg to connect is a set of empty quotes.

## Regards, Trevor

Trevor S.  
[http://somethinglearned.com](http://somethinglearned.com)

---

<div class="post-metadata">

**Author:** ![sweatje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@sweatje](https://www.ruby-forum.com/u/sweatje)\
**Post date:** [June 9, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/app-at-root-domain/62939/4 "2006-06-09T21:44:28Z")

</div>

Perfect… thanks fellas!

---

<div class="post-metadata">

**Author:** ![sweatje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@sweatje](https://www.ruby-forum.com/u/sweatje)\
**Post date:** [June 9, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/app-at-root-domain/62939/5 "2006-06-09T19:46:26Z")

</div>

Jason S. wrote:

> I have my app up and running at [www.domainname.com/controller/](http://www.domainname.com/controller/) … but  
> need to get it set up at just [www.domainname.com](http://www.domainname.com)
> 
> I see that by default, rails is loading the pre-made index file in the  
> /public dir. How can I override this without changing any directories  
> around in my app?
> 
> Thanks!  
> -stirman

1. delete public/index.html

2. add a route in config/routes.rb that looks like:
