Ask A Question
Notifications
You’re not receiving notifications from this thread.
Getting No route matches "index.html.var" errors
Hello,
My Ruby app has been running for the last two months on Hostgator with no issues. I have not changed one line of code.
All of a sudden, on March 9th, trying to access my website using the base URL ( not the actual domain, but I'll use it for this post http://www.example.com) is throwing the following errors (from /log/production.log)
[4;36;1mSQL (0.5ms)[0m [0;1mSET SQL_AUTO_IS_NULL=0[0m
Processing ApplicationController#index (for 174.114.60.37 at 2019-03-16 08:10:22) [GET]
ActionController::RoutingError (No route matches "/index.html.var" with {:method=>:get}):
My routes.db file is shown below:
ActionController::Routing::Routes.draw do |map|
map.root :controller => "mylittleapp"
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format' end
My htaccess file is shown below
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12006\/$1" [P,L]
HOWEVER, if I try to access the Ruby app using http://www.example.com/mylittleapp, then the app is accessible and everything works fine.
Key points:
- The website has been working fine for two months and is accessible from the base URL, so I know that Rails was routing it to the correct ActionController.
- I have not made any code changes to the site
- Something mysteriously changed and now "index.html.var" is being passed in and the Rail Router cannot find a route, so it throws an error and calls 404.html
- The actual Ruby app is operational, but just not accessible from its base URL. My suspicion is that Hostgator changed either a .httpd config flag or modified my .htaccess file. Any suggestions on how to resolve this? Thanks