[Rails] Re: routing failures

Craig White
2006-02-14T18:26:35Z

On Tue, 2006-02-14 at 16:22 +0100, Alan Francis wrote:
> Craig White wrote:
> > OK - one more time with clarity points added...
> >
> > probably something really simple but I don''t understand.
> >
> > Shifting to Apache to w/ fastcgi (definitely feels faster than
webrick)
> >
> > Anyway, I set the default route in routes.rb to be
> >
> >   map.connect '''', :controller =>
"placements", :action => ''list''
> >
> > which worked once I figured out apache...
> >
> > Anyway, now that I have done that, all attempts to access stuff inside
> > the public directory fails (stylesheets, javascripts etc.) with this
in
> > the logs...
>
> It sounds more like .htaccess problem, since a request for a static file
> is being passed to rails for routing, it''s somehow being skipped
by the
> .htaccess rules.
>
> Here''s the relevant section from a random rails app on my HD (not
sure
> how old it is, but it''s the default, unchanged, .htaccess)
>
> # Redirect all requests not available on the filesystem to Rails
> # By default the cgi dispatcher is used which is very slow
> #
> # For better performance replace the dispatcher with the fastcgi one
> #
> # Example:
> #   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
> RewriteEngine On
> RewriteRule ^$ index.html [QSA]
> RewriteRule ^([^.]+)$ $1.html [QSA]
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
>
> You''ll have changed that last line to be fcgi, but all the others
should
> be unchanged.... are they ?
>
> Random aside, are you using Windows ?
----
No - not Windows, CentOS 4 (Linux)

I had uncommented this line...

#   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

as I am certain that one of the instruction pages had told me to
uncomment it...and of course, commenting it out once again and
restarting apache seems to have fixed it.

Thanks

Craig