diff --git a/django/contrib/redirects/middleware.py b/django/contrib/redirects/middleware.py index 32f2760c45..8998c2ce3e 100644 --- a/django/contrib/redirects/middleware.py +++ b/django/contrib/redirects/middleware.py @@ -19,7 +19,7 @@ class RedirectFallbackMiddleware(object): except Redirect.DoesNotExist: pass if r is not None: - if r == '': + if r.new_path == '': return http.HttpResponseGone() return http.HttpResponsePermanentRedirect(r.new_path)