The default bug view has changed. See this FAQ.

Handling of redirects via query strings leads to bad copy and paste.

RESOLVED FIXED

Status

Mozilla Developer Network
Design
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Jeff Hammel, Unassigned)

Tracking

(Blocks: 1 bug)

Details

(Reporter)

Description

4 years ago
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?
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.
(Reporter)

Comment 2

4 years ago
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
Duplicate of this bug: 770969
(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

4 years ago
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/
Blocks: 872593
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.
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);
}
Duplicate of this bug: 930027

Comment 9

3 years ago
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
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
FWIW, I found https://bugzilla.mozilla.org/show_bug.cgi?id=971772 after we landed this fix.
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!
Depends on: 971793
You need to log in before you can comment on or make changes to this bug.