Use REQUEST_URI to get the URL for redirector
authorMagnus Hagander <magnus@hagander.net>
Fri, 1 Jan 2016 16:18:26 +0000 (17:18 +0100)
committerMagnus Hagander <magnus@hagander.net>
Fri, 1 Jan 2016 16:18:26 +0000 (17:18 +0100)
This one works  both under a local dev webserver and importantly also
on the production server...

redirector/redirector.py

index 55dc6ce9ee6ce930c607f939b877631de670cf36..7f918f8b4e945e44e7e27883ad37b0a2ccb6be3d 100755 (executable)
@@ -27,7 +27,7 @@ def iddecode(idstr):
 def application(environ, start_response):
        try:
                # Start by getting the id from the request
-               id = iddecode(environ['PATH_INFO'].split('/')[-1])
+               id = iddecode(environ['REQUEST_URI'].split('/')[-1])
 
                # Let's figure out where this URL should be