fhttpy/modules/http/file-handlers/htaccess.py

18 lines
486 B
Python
Raw Normal View History

2022-02-14 21:43:12 +00:00
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)
path = p(*pathl,".fhtpyaccess")
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