Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #21354 -- Documented contrib.redirects defaults to 301 redirects

Thanks glarrain for the suggestion.
  • Loading branch information...
commit 073b974e6613adc88cade7d34af701e52e2cc8fd 1 parent 6107435
Bouke Haarsma authored November 01, 2013 timgraham committed November 02, 2013

Showing 1 changed file with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. 10  docs/ref/contrib/redirects.txt
10  docs/ref/contrib/redirects.txt
@@ -6,7 +6,8 @@ The redirects app
6 6
    :synopsis: A framework for managing redirects.
7 7
 
8 8
 Django comes with an optional redirects application. It lets you store simple
9  
-redirects in a database and handles the redirecting for you.
  9
+redirects in a database and handles the redirecting for you. It uses the HTTP
  10
+response status code ``301 Moved Permanently`` by default.
10 11
 
11 12
 Installation
12 13
 ============
@@ -34,7 +35,12 @@ given ``old_path`` with a site ID that corresponds to the
34 35
 :setting:`SITE_ID` setting.
35 36
 
36 37
 * If it finds a match, and ``new_path`` is not empty, it redirects to
37  
-  ``new_path``.
  38
+  ``new_path`` using a 301 ("Moved Permanently") redirect. You can subclass
  39
+  :class:`~django.contrib.redirects.middleware.RedirectFallbackMiddleware`
  40
+  and set
  41
+  :attr:`~django.contrib.redirects.middleware.RedirectFallbackMiddleware.response_redirect_class`
  42
+  to :class:`django.http.HttpResponseRedirect` to use a
  43
+  ``302 Moved Temporarily`` redirect instead.
38 44
 * If it finds a match, and ``new_path`` is empty, it sends a 410 ("Gone")
39 45
   HTTP header and empty (content-less) response.
40 46
 * If it doesn't find a match, the request continues to be processed as

0 notes on commit 073b974

Please sign in to comment.
Something went wrong with that request. Please try again.