Opened 6 years ago

Closed 6 years ago

#14153 closed (invalid)

Redirects fail if URL has appended query string

Reported by: richardb Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords: redirect
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:


The redirect middleware obtains the path of the current request with path = request.get_full_path(), then tries to find a match in the Redirect table.
If there is an appended query string, it will include this when querying the Redirect table (and so fail to find a match).
Shouldn't we use path = request.path instead?

Change History (3)

comment:1 Changed 6 years ago by dmoisset

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

I think the problem should be considered more carefully. One possible use of the redirect app is to be used in a site migration, where you actually might want to redirect based in query string (for example if your old site used ugly URLs like index.php?doc_id=101

comment:2 Changed 6 years ago by dmoisset

  • Triage Stage changed from Accepted to Design decision needed

comment:3 Changed 6 years ago by lukeplant

  • Resolution set to invalid
  • Status changed from new to closed

For the reason given by dmoisset, and for backwards compatibility for people relying on current behaviour, I'm going to close as INVALID. At the moment, if you want the query string to be ignored you'll have to roll your own. A setting is not good solution for this, since you might have a mixture of cases where you want the query string and where you don't. A fuller solution would almost certainly require changes to the model, and we don't have a migration framework to support that.

Note: See TracTickets for help on using tickets.
Back to Top