Implementing the Front Controller Pattern in Lighttpd
One of the more common design patterns in installable web applications today is the Front Controller pattern. Unlike other web applications that have separate files to respond to specific requests, the front controller pattern funnels all requests through a single file, and that file processes the requested URL to respond as appropriate.
In typical scenarios, you’ll accomplish this with Apache using a set of mod_rewrite directives. These directives first check to see if the requested file or directory exists. If it does not exist, then the request is passed on to the front controller. This allows requests for existing files - like images, stylesheets, and client-side scripts - to be requested directly rather than passing through the URL rewriting mechanism.