diff --git a/ietf/redirects/views.py b/ietf/redirects/views.py index 3d19c6b76..3e67f0932 100644 --- a/ietf/redirects/views.py +++ b/ietf/redirects/views.py @@ -33,4 +33,11 @@ def redirect(request, path="", script=""): url = re.sub(r'/+', '/', url) if remove: url = re.sub(re.escape(remove) + "/?$", "", url) + # Copy the GET arguments, remove all the ones we were + # expecting and if there are any left, add them to the URL. + get = request.GET.copy() + for arg in re.findall(r'%\(([^)]+)\)', rest): + get.pop(arg) + if get: + url += '?' + get.urlencode() return HttpResponseRedirect(url)