quick question: I created a web server using CherryPy. It requires authentication for all pages, so my default handler returns the login page object. Due to CherryPy handling mailings, someone who asks for:
localhost:80/a/b/c
will be redirected to:
localhost:80/a/b/login
however, I would like all unauthenticated requests to be invoked from the root level, regardless of the potential additional parameters added in the HTML, eG request:
localhost:80/a/b/c --> localhost:80/login
I am currently solving this by returning an HTML based redirect:
'<meta http-equiv="REFRESH" content="0;url=/login">'
I think this is a very unclean solution and would rather want to use a CherryPy based solution. I looked at cherrypy.HTTPRedirect and cherrypy.url, but I did not find a way to make them work for this problem.
Any thoughts?
Thanks!
Muppet
source share