Rails routes and mod_rewrite

November 4, 2005 Link to post  Permalink

I have a Rails app that uses lighttpd. My app has a bunch of routes setup to handle incoming requests. Lighttpd has a set of re-write rules to convert the incoming request into calls into dispatch.fcgi. This is the default configuration.

One thing that hadn’t been made very clear to me until I went looking for it is that the lighttpd re-write rules are no longer necessary.

To get the requests into my Rails app, all I need to do is define dispatch.fcgi as my 404 handler, and any request that doesn’t exist in the file system will be handled by my Rails app.

This is fully documented here but as I said, it wasn’t obvious to me until I needed to fix it!