I am using webdev to serve some static web pages (Help documents) in a mounted folder. I am looking for a way to redirect a 404 or 500 error to an index/home page. This is to handle cases when links from Perspective are broken.
You can't do this with the mounted folder type.
You'd have to script it with a Python resource - take the incoming path, check the remainder, look for the file on disk, serve it if it's found. If it's not found, return a 302 or some other code with a Location
of the index page:
Note the advice in this thread w.r.t path traversal risks:
How is it severed if found? I think I understand how to setup the redirect.
Take a closer look at the linked post. I linked some methods you would use to serve the file.