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