Why 404 redirection?

I have two questions about the 404 error redirection technique, which I
first saw with Lighttpd/FastCGI and now see with Litespeed 2.2 LSAPI

  1. Why is this a good idea? It seems like using errors to control
    program flow, which is a big no-no where I come from.

  2. How do real 404s get passed along and handled? In other words, say
    â??/images/rails.pnqâ? is not found in the file system. The redirection
    would pass that URI to Rails, which would claim a routing error. Is it a
    Rails error? No, itâ??s a static file not found.

People (me included) were having lots of trouble with Lighttpd/FastCGI
and welcomed the Mongrel/proxy setup with welcome arms. Now along comes
LSAPI and the 404 redirect is back. It seems suspect to me, but that’s
likely just a lack of understanding - thus the reason for this post.

I would never understand a really low-level explanation of C pointers or
memory maps or whatever, but a simple explanation of the reasoning for
this would help ease this dull migraine Iâ??ve got going. :slight_smile:




Hi Kevin,

We does that for the sake of performance, 404 handler can be processed
faster than rewrite rules, the default rewrite rules for Rails request
dispatching is just like a manually crafted 404 handler.
However, with LiteSpeed 2.2 LSAPI, vhost level rewrite rules have higher
priority than 404 handler, so if you prefer using rewrite rules, just
customize your own rewrite rules to determine what URLs should be routed
to Rails.
It is better to have the web server serving static files when proxy to
mongrel on localhost.

Best Regards,
George W.