# Problem with root

**URL:** <https://discuss.rubyonrails.org/t/problem-with-root/69904>\
**Category:** rubyonrails-talk\
**Created:** [November 24, 2014, 6:10pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904 "2014-11-24T18:10:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [November 24, 2014, 6:10pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904/1 "2014-11-24T18:10:52Z")

</div>

Hi All,

I'm new in the ruby on rails world. I would like to ask you about any advice according to this problem

I'm having problems with redirection, I have this line in the routes.rb

root :to =\> 'welcome#index', :as =\> 'home'

in the app/controllers folder I have welcome\_controller.rb

and in the views/welcome/index.html.erb file

but when I use [http://my.domain.com/](http://my.domain.com/)

I have the 404 page.

but if I use [http://my.domain.com/login](http://my.domain.com/login), it does work.

Thanks

---

<div class="post-metadata">

**Author:** ![Jason\_FB](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/jason_fb/32/826_2.png) [@Jason\_FB](https://discuss.rubyonrails.org/u/Jason_FB)\
**Post date:** [November 24, 2014, 6:15pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904/2 "2014-11-24T18:15:25Z")

</div>

show us what happens when you run

tail -f log/development.log

in a console window _ **while** _ you hit the page in your browser

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [November 24, 2014, 6:26pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904/3 "2014-11-24T18:26:33Z")

</div>

Hi Jason,

using this tail -f log/development.log, and then requesting the domain, it does not show anything, but in the log of the site it does have these messages:

Started GET "/index.html" for 192.222.129.185 at 2014-11-24 12:47:46 -0500

ActionController::RoutingError (No route matches [GET] "/index.html"): &nbsp;&nbsp;actionpack (3.2.19) lib/action\_dispatch/middleware/debug\_exceptions.rb:21:in `call' &nbsp;&nbsp;actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' &nbsp;&nbsp;railties (3.2.19) lib/rails/rack/logger.rb:32:in `call_app' &nbsp;&nbsp;railties (3.2.19) lib/rails/rack/logger.rb:16:in `block in call' &nbsp;&nbsp;activesupport (3.2.19) lib/active\_support/tagged\_logging.rb:22:in `tagged' &nbsp;&nbsp;railties (3.2.19) lib/rails/rack/logger.rb:16:in `call' &nbsp;&nbsp;actionpack (3.2.19) lib/action\_dispatch/middleware/request\_id.rb:22:in `call' &nbsp;&nbsp;rack (1.4.5) lib/rack/methodoverride.rb:21:in `call' &nbsp;&nbsp;rack (1.4.5) lib/rack/runtime.rb:17:in `call' &nbsp;&nbsp;activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in `call' &nbsp;&nbsp;rack (1.4.5) lib/rack/lock.rb:15:in `call' &nbsp;&nbsp;actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in `call' &nbsp;&nbsp;rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward' &nbsp;&nbsp;rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch' &nbsp;&nbsp;rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup' &nbsp;&nbsp;rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!' &nbsp;&nbsp;rack-cache (1.2) lib/rack/cache/context.rb:51:in `call' &nbsp;&nbsp;railties (3.2.19) lib/rails/engine.rb:484:in `call' &nbsp;&nbsp;railties (3.2.19) lib/rails/application.rb:231:in `call' &nbsp;&nbsp;railties (3.2.19) lib/rails/railtie/configurable.rb:30:in `method\_missing' &nbsp;&nbsp;passenger (4.0.53) lib/phusion\_passenger/rack/thread\_handler\_extension.rb:74:in `process_request' &nbsp;&nbsp;passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept\_and\_process\_next\_request' &nbsp;&nbsp;passenger (4.0.53) lib/phusion\_passenger/request\_handler/thread\_handler.rb:109:in `main_loop' &nbsp;&nbsp;passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start\_threads'

Jason Fb wrote in post #1163214:

---

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [November 24, 2014, 6:37pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904/4 "2014-11-24T18:37:27Z")

</div>

What does the Apache conf file look like for this host? Apache is trying to tack an auto-index on this page, which is messing with the route passed in from Passenger.

Here's a snippet from one of mine -- note the -Indexes directive. Does yours have that?

&nbsp;&nbsp;\<Directory /data/www/example.com/public\> &nbsp;&nbsp;&nbsp;&nbsp;Options -Indexes FollowSymLinks -MultiViews &nbsp;&nbsp;&nbsp;&nbsp;AllowOverride All &nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny &nbsp;&nbsp;&nbsp;&nbsp;allow from all &nbsp;&nbsp;\</Directory\>

Walter

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [November 24, 2014, 6:44pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904/5 "2014-11-24T18:44:43Z")

</div>

Hi Walter this is mine:

\<VirtualHost \*:80\> &nbsp;&nbsp;&nbsp;&nbsp;ServerName my.domain.com &nbsp;&nbsp;&nbsp;&nbsp;DocumentRoot /var/www/ &nbsp;&nbsp;&nbsp;&nbsp;ErrorLog logs/redmine\_error\_log

&nbsp;&nbsp;&nbsp;\<Directory "/var/www/redmine/public/"\> &nbsp;&nbsp;&nbsp;&nbsp;Options -MultiViews Indexes ExecCGI FollowSymLinks &nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny &nbsp;&nbsp;&nbsp;&nbsp;Allow from all &nbsp;&nbsp;&nbsp;&nbsp;AllowOverride all &nbsp;&nbsp;&nbsp;\</Directory\> \</VirtualHost\>

if I set -Indexes, the site does not work at all.

Walter Davis wrote in post #1163219:

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [November 24, 2014, 7:10pm UTC](https://discuss.rubyonrails.org/t/problem-with-root/69904/6 "2014-11-24T19:10:53Z")

</div>

I got the solution of the problem,

in the .htaccess file I had this rule

RewriteRule ^$ index.html [QSA]

I comment it and now it works like a charm.

Thank you!

Francisco Bereciartu wrote in post #1163221:
