1 #!/usr/bin/env python 2 3 """ 4 Handle Confluence wiki dashboard action requests. 5 """ 6 7 import cgi, sys 8 9 # An empty string means that the wiki is anchored at the site root. 10 11 URL_PREFIX = "" 12 13 def redirect(): 14 location = "%s/" % URL_PREFIX 15 16 print """\ 17 Status: 302 Redirect to page 18 Location: %s 19 Content-Type: text/html 20 21 <html> 22 <head><title>Redirecting to Page</title></head> 23 <body> 24 <h1>Redirecting to Page</h1> 25 <p>If you see this message, try following <a href="%s">this link</a>.</p> 26 </body> 27 </html> 28 """ % (location, cgi.escape(location, True)) 29 sys.exit(0) 30 31 if __name__ == "__main__": 32 redirect() 33 34 # vim: tabstop=4 expandtab shiftwidth=4