if conf.friendly_urls then
uri_map = { -- URI remapping
match = "^[^%./]*/?([^%.]*)$",
with = redirect,
params = {
"/",
function(req,res,cap)
local vars = {}
for var in string.gmatch(cap[1], '([^/]+)') do
table.insert(vars,var)
end
if #vars > 0 then
local mod = (#vars % 2) - 1
local get = ""
if #vars > 1 - mod then
for i = 2 - mod, #vars, 2 do
get = get.."&"..vars[i].."="..vars[i+1]
end
end
if mod == -1 then
get = vars[2]..get
end
req.cmd_url = "/index.lua?"..conf.route_parameter.."="..vars[1].."/"..get
else
req.cmd_url = "/index.lua"
end
return "reparse"
end
}
}