def main(): def handleHTTP(event,eenv,env): env["htaccessPropagate"] = True paths = [indexPath] + env["lPath"].split(os.path.sep)[:-1] pathl = [] for pathbit in paths: pathl.append(pathbit) pathle = pathl + [".fhtpyaccess"] path = p(*pathle) if not os.path.isfile(path): continue handlePYP(env,path) if env["htaccessPropagate"] == False: return True addEventHandler("handleHTTP",handleHTTP) main() fileHandlers["fhtpyaccess"] = handle404 fileHandlers["htaccess"] = handle404