fhttpy/modules/http/file-handlers/htaccess.py
2022-02-14 23:54:20 +01:00

19 lines
509 B
Python

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