Last Comment Bug 836529 - Handling of redirects via query strings leads to bad copy and paste.
: Handling of redirects via query strings leads to bad copy and paste.
Status: RESOLVED FIXED
:
Product: Mozilla Developer Network
Classification: Other
Component: Design (show other bugs)
: unspecified
: All All
: -- normal with 5 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 770969 930027 (view as bug list)
Depends on: 971793
Blocks: 872593
  Show dependency treegraph
 
Reported: 2013-01-30 15:03 PST by Jeff Hammel
Modified: 2014-02-12 09:19 PST (History)
9 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Jeff Hammel 2013-01-30 15:03:40 PST
Very often someone will ask for or imply they want the link to a page on MDN and sometimes I know it.  But people move stuff around.  So I start to type, "automat.." which Firefox completes to the old value: https://developer.mozilla.org/en/Mozilla_automated_testing . However, this page has been moved *AND* there is a bug in firefox (which i'm fairly sure is both filed and really really old) whereby 301 MOVED PERMANANTLY should (IMO) be renamed in awesomebar completion.  

So I navigate to the page, which is now moved to https://developer.mozilla.org/en-US/docs/Mozilla/QA/Automated_testing . However, MDN adds on some stuff so now I have in my URL bar https://developer.mozilla.org/en-US/docs/Mozilla/QA/Automated_testing?redirectlocale=en-US&redirectslug=Mozilla_automated_testing .

Instead of copy+pasting the URL bar location, now I have to edit it, nor is the a (sic) "permalink" I can click on to get rid of the garbage.  I also have what has clearly become a minority belief that (exposed) URLs should be semantic.

I would have conveyed this information with a cookie or session.  Is there any reason this can't/shouldn't be done here?
Comment 1 Eric Shepherd [:sheppy] 2013-01-30 15:05:35 PST
Maybe we can use history.rewrite to change the URL after loading so that it looks pretty. We use the URL for this so that the page knows that a redirect occurred and where the originating page was.
Comment 2 Jeff Hammel 2013-01-30 15:42:36 PST
The text below the page title (where you use this information and link to the old page) is a bit odd too.  Pasting the markup for clarity:

<div class="redirected-from" id="redirected-from">
              <p>Redirected from <a href="/en-US/docs/Mozilla_automated_testing?redirect=no">Mozilla automated testing Redirect 1</a></p>
            </div>

IMHO, kill the "Redirect 1" from the text node of <a>.  This tells me nothing as a user
Comment 3 Eric Shepherd [:sheppy] 2013-03-26 09:30:47 PDT
*** Bug 770969 has been marked as a duplicate of this bug. ***
Comment 4 Eric Shepherd [:sheppy] 2013-05-16 06:43:33 PDT
(In reply to Jeff Hammel [:jhammel] from comment #2)

> IMHO, kill the "Redirect 1" from the text node of <a>.  This tells me
> nothing as a user

Yes; agreed, we have another bug on that. See bug 820913.
Comment 5 Nickolay_Ponomarev 2013-05-25 08:17:17 PDT
from bug 770969 comment 1:
> Maybe we could get rid of the parameters by using a session message [1] to
> trigger the same "you've just been redirected" warning?
> 
> [1]: https://docs.djangoproject.com/en/1.2/ref/contrib/messages/
Comment 6 Eric Shepherd [:sheppy] 2013-08-08 14:27:42 PDT
This is a really, really big problem, and actually probably what I get the most complaints about from users in IRC. Devs get really frustrated about having to edit the URLs they copy and paste from MDN because of this.
Comment 7 Anthony Ricaud (:rik) 2013-08-31 07:44:51 PDT
This is annoying me a lot too. Here's a simple "patch" without touching the backend:

if (history.replaceState) {
  history.replaceState(null, null, location.pathname + location.hash);
}
Comment 8 Florian Scholz [:fscholz] (MDN) 2013-10-23 11:25:57 PDT
*** Bug 930027 has been marked as a duplicate of this bug. ***
Comment 9 [github robot] 2014-02-12 01:21:46 PST
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/85398a13f1b0c17a4bcb7b1b2d01c60c35814b76
bug 836529, bug 820913: Switch to django messages framework for redirect notices, remove the redirection parameters from the URL

https://github.com/mozilla/kuma/commit/b299956c2918190565064cfee9b6d3c899dc4fa7
Merge pull request #1951 from lmorchard/836529-redirection-urls

bug 836529, bug 820913: Switch to django messages framework for redirect notices, remove the redirection parameters from the URL
Comment 10 Luke Crouch [:groovecoder] 2014-02-12 08:56:25 PST
FWIW, I found https://bugzilla.mozilla.org/show_bug.cgi?id=971772 after we landed this fix.
Comment 11 Eric Shepherd [:sheppy] 2014-02-12 09:12:56 PST
You guys! This is awesome!

Teoli did notice that the little gray "redirected from" URL includes "?redirect=no" at the end; I think he's filing a bug for it. But other than that little hiccup, wow, this is amazing!

Note You need to log in before you can comment on or make changes to this bug.