﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23531	APPEND_SLASHES behavior shouldn't redirect with a 301	Matt Robenolt	nobody	"Redirecting with a permanent redirect (HttpResponsePermanentRedirect) can lead to 404s and other unexpected behavior when things move around.

For example:

In settings.py, `APPEND_SLAHSES = True` (the default behavior)

In urls.py `url(r'foo/$', ..._`

A user visits `example.com/foo` and gets redirected to `example.com/foo/` as expected.

Later, we decide that we don't like slashes in our urls, and change to `APPEND_SLASHES = False` and change our url route to `url(r'foo$', ...`

A user visits `example.com/foo` again (which is now the correct url) and their browser redirects them to `example.com/foo/` which is now a 404.

This behavior happens specifically because Django has told it that this redirect is 100% going to happen, so the browser caches it and doesn't ask the server again. In my opinion, it's a bad idea that Django makes this assumption because it has no insight into what future plans are and whatnot.

This behavior has also existed since at least 2007, so I'm not sure how much effort needs to go into changing this moving forward for 1.8+."	Bug	new	Core (URLs)	dev	Normal		common, middleware, redirect		Unreviewed	1	0	0	0	0	0
