Problem with root

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/

I have the 404 page.

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

Thanks

show us what happens when you run

tail -f log/development.log

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

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/

I have the 404 page.

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


Jason Fleetwood-Boldt
[email protected]

All material © Jason Fleetwood-Boldt 2014. Public conversations may be
turned into blog posts (original poster information will be made
anonymous). Email [email protected] with questions/concerns about
this.

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”):
actionpack (3.2.19)
lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in call’
railties (3.2.19) lib/rails/rack/logger.rb:32:in call_app' railties (3.2.19) lib/rails/rack/logger.rb:16:in block in call’
activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:in
tagged' railties (3.2.19) lib/rails/rack/logger.rb:16:in call’
actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:in
call' rack (1.4.5) lib/rack/methodoverride.rb:21:in call’
rack (1.4.5) lib/rack/runtime.rb:17:in call' activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in call’
rack (1.4.5) lib/rack/lock.rb:15:in call' actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in call’
rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:245:in fetch’
rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:in call!’
rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.19) lib/rails/engine.rb:484:in call’
railties (3.2.19) lib/rails/application.rb:231:in call' railties (3.2.19) lib/rails/railtie/configurable.rb:30:in method_missing’
passenger (4.0.53)
lib/phusion_passenger/rack/thread_handler_extension.rb:74:in
process_request' passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:141:in accept_and_process_next_request’
passenger (4.0.53)
lib/phusion_passenger/request_handler/thread_handler.rb:109:in
main_loop' passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:in block (3 levels) in start_threads’

Jason Fb wrote in post #1163214:

show us what happens when you run

tail -f log/development.log

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

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/

I have the 404 page.

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


Jason Fleetwood-Boldt
[email protected]
http://www.jasonfleetwoodboldt.com/writing

All material © Jason Fleetwood-Boldt 2014. Public conversations may be
turned into blog posts (original poster information will be made
anonymous). Email [email protected] with questions/concerns about
this.

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?

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

Walter

Hi Walter this is mine:

<VirtualHost *:80>
ServerName my.domain.com
DocumentRoot /var/www/
ErrorLog logs/redmine_error_log

<Directory “/var/www/redmine/public/”>
Options -MultiViews Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all

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

Walter D. wrote in post #1163219:

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?

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

Walter

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:

Hi Walter this is mine:

<VirtualHost *:80>
ServerName my.domain.com
DocumentRoot /var/www/
ErrorLog logs/redmine_error_log

<Directory “/var/www/redmine/public/”>
Options -MultiViews Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all

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

Walter D. wrote in post #1163219:

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?

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

Walter