Last updated by Garrett Albright on Fri, 2010-07-02 21:38
The attached script allows you to use Drupal's clean URLs feature, as well as force the addition or removal of "www." from web addresses just like Drupal's .htaccess file does. It will also easily allow you to use the Boost caching module with Lighty for even better performance.
For information on how to get Lighty to use this script, see the docs page on mod_magnet. Note that the script may require some minor editing - the abundant comments should make it evident what needs to be done. If you want to customize it even further, the Lua reference manual will be very helpful. You will probably want to remove the .txt from the end of the filename, so that the file's extension is just .lua.
Use this discussion thread to discuss this script.
This script requires a recent version of Lighttpd. I'm not sure of the exact version, but some current Linux distributions (maybe just Debian-based ones?, though that includes the popular Ubuntu) offer an outdated version of Lighttpd, 1.4.19, which is very old (it was released in March of 2008). You will need to acquire a more recent version of Lighttpd to use this script properly. Linux binaries of the most recent release can be downloaded from the Lighty web site, or you can build from source. (Use
lighttpd -v at the command line to see what version is installed on your computer/server.) See the discussion here for more information.