url.rewrite-once = ( "^$" => "/cgi-bin/index.cgi" ) url.rewrite-once = ( "^([0-9A-Z]{12})/(.+)$" => "/cgi-bin/index.cgi?act=download1&id=$1&fname=$2" ) url.rewrite-once = ( "^del\-([0-9A-Z]{12})\-([0-9A-Z]+)/.+$" => "/cgi-bin/index.cgi?del=$1-$2" ) $HTTP[”url”] =~ “^.*(html|php|/).*$” { magnet.attract-physical-path-to = (”/etc/lighttpd/filebong-magnet-rewrite.lua”) } Next you need to create a file (wherever you want) /etc/lighttpd/filebong-magnet-rewrite.lua and its content: if (not lighty.stat(lighty.env["physical.path"])) then lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. "/cgi-bin/index.cgi?act=page&tmpl=$1" end