Using environ instead of request.META, as this is a wsgi app.
Cleaning up destination addresses where there is no querystring.