Use a 301 permanent redirect.
Add a trailing slash, so that we're not redirecting to a redirect. - Legacy-Id: 343
This commit is contained in:
parent
0d2bbe54e9
commit
fd0ec05be1
|
@ -1,4 +1,4 @@
|
||||||
from django.http import HttpResponseRedirect,Http404
|
from django.http import HttpResponsePermanentRedirect,Http404
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from ietf.redirects.models import Redirect, Command
|
from ietf.redirects.models import Redirect, Command
|
||||||
|
@ -25,6 +25,7 @@ def redirect(request, path="", script=""):
|
||||||
pass # it's ok, request didn't have 'command'.
|
pass # it's ok, request didn't have 'command'.
|
||||||
try:
|
try:
|
||||||
url += rest % request.REQUEST
|
url += rest % request.REQUEST
|
||||||
|
url += "/"
|
||||||
except:
|
except:
|
||||||
# rest had something in it that request didn't have, so just
|
# rest had something in it that request didn't have, so just
|
||||||
# redirect to the root of the tool.
|
# redirect to the root of the tool.
|
||||||
|
@ -40,4 +41,4 @@ def redirect(request, path="", script=""):
|
||||||
get.pop(arg)
|
get.pop(arg)
|
||||||
if get:
|
if get:
|
||||||
url += '?' + get.urlencode()
|
url += '?' + get.urlencode()
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponsePermanentRedirect(url)
|
||||||
|
|
Loading…
Reference in a new issue