-- little helper function function file_exists(path) local attr = lighty.stat(path) if (attr) then return true else return false end end if (file_exists(lighty.env["physical.doc-root"] .. "/.clean-url")) then if (not file_exists(lighty.env["physical.path"])) then -- file still missing. pass it to the fastcgi backend local request_uri = lighty.env["uri.path"] if request_uri then lighty.env["uri.path"] = "/index.php" local uriquery = lighty.env["uri.query"] or "" lighty.env["uri.query"] = uriquery .. (uriquery ~= "" and "&" or "") .. "q=" .. request_uri lighty.env["physical.rel-path"] = lighty.env["uri.path"] lighty.env["request.orig-uri"] = lighty.env["request.uri"] lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"] end end end -- fallthrough will put it back into the lighty request loop -- that means we get the 304 handling for free. ;)