# Setting URL root / change Public/index.html default

**URL:** <https://www.ruby-forum.com/t/setting-url-root-change-public-index-html-default/144174>\
**Category:** Ruby-Forum\
**Created:** [July 26, 2008, 5:50am UTC](https://www.ruby-forum.com/t/setting-url-root-change-public-index-html-default/144174 "2008-07-26T05:50:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@samraj](https://www.ruby-forum.com/u/samraj)\
**Post date:** [July 26, 2008, 5:50am UTC](https://www.ruby-forum.com/t/setting-url-root-change-public-index-html-default/144174/1 "2008-07-26T05:50:59Z")

</div>

NTS:

The default URL for a new rails app is the index.html file in the Public  
folder.

If you want to change the default to another page, do the following:

In the routes.rb file in the Public folder add the following code at the  
lowest priority, or right before “end”, the last word in the document:

map.connect ‘’, :controller =\> “controller\_you\_want\_as\_a\_default”

- make sure you have an index.rhtml file in the view associated with the  
controller you insert in the latter code.

- or make sure that you render/redirect the index def to an action with  
a view.

- or follow your customizations if you have something besides index.html  
as the default.
