Tuesday, October 19, 2010

ActionController::RoutingError No route matches .html

Added extra .html to URL in rails.

If you have added following rewiterules in apache configuration Or added in your .htaccess in your public. Basically its required for the FastCGI. if you run fastCGI server then its need, but if you running Passenger
should be remove
---------------------------------------
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
----------------------------------------

So solution is please remove that from apache config Or remove .htaccess for the passenger only. njoy.!