Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More and more links are running into a 404 #6629

Closed
3 tasks done
alexander-schranz opened this issue Jun 28, 2022 · 9 comments · Fixed by #7070
Closed
3 tasks done

More and more links are running into a 404 #6629

alexander-schranz opened this issue Jun 28, 2022 · 9 comments · Fixed by #7070
Assignees
Labels
p3 We don't have visibility when this will be addressed. redirects all things related to redirecting

Comments

@alexander-schranz
Copy link

alexander-schranz commented Jun 28, 2022

Summary

More and more links to mdn docs are landing on page not found. Not sure what was restructered but it would be nice to track 404 and check where the content was moved.

URL

https://developer.mozilla.org/en-US/Core_JavaScript_1.5_Guide/Exception_Handling_Statements/try...catch_Statement

If I don't forget I will add here over the time more links, but I would recommend tracking the 404 and redirect them correctly.

Reproduction steps

Somewhere today I clicked a link like this: https://developer.mozilla.org/en-US/Core_JavaScript_1.5_Guide/Exception_Handling_Statements/try...catch_Statement and this content seems to be gone or not correctly redirected.

Expected behavior

Redirect to to most new page with for that content.

Actual behavior

ends in 404

Device

Desktop

Browser

Firefox

Browser version

Stable

Operating system

Mac OS

Screenshot

No response

Anything else?

Filled a bug report because of: https://twitter.com/MozDevNet/status/1541832746334650369

Validations

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 28, 2022
@teoli2003
Copy link
Contributor

If I remember correctly we moved Core_JavaScript_1.5_Guide pages to their current location in 2014 or 2015. I'm surprised there are still links to these old URLs out there. Out of curiosity, where did you find such links?

@alexander-schranz
Copy link
Author

Not sure where but for example stackoverflow answers link to it: https://stackoverflow.com/questions/5963045/can-syntax-errors-be-caught-in-javascript.
The internet never forget something 😄

@teoli2003
Copy link
Contributor

teoli2003 commented Jul 1, 2022

Yes, it is worth fixing (and not too difficult)
@schalkneethling Do you think you can provide the list of 404 pages with Core_JavaScript_1.5_Guide in their slug over the last year, then we can add the modern pages and add redirects.

If we solve it this way, we can transfer this to mdn/content.

@schalkneethling
Copy link
Contributor

Yes, it is worth fixing (and not too difficult) @schalkneethling Do you think you can provide the list of 404 pages with Core_JavaScript_1.5_Guide in their slug over the last year, then we can add the modern pages and add redirects.

If we solve it this way, we can transfer this to mdn/content.

I believe the best person for that would be either @Guyzeroth or @fiji-flo

@alexander-schranz
Copy link
Author

@schalkneethling
Copy link
Contributor

@mdn/core-dev I have also run into this with /community if used without a locale. https://developer.mozilla.org/community is a 404 but https://developer.mozilla.org/en-US/community is fine

@caugner
Copy link
Contributor

caugner commented Aug 22, 2022

First of all, we do track 404s and we add missing redirects for frequently visited urls from time to time.

In the case of the URL you're citing, it appears that mdn/content#1857 removed the corresponding explicit redirects from _redirects.txt (in mdn/content), because they were added to our fundamental redirects (here in mdn/yari) in #2698. And they still seem to be (except that they require the /docs/ part in the url):

localeRedirect(/^docs\/Core_JavaScript_1.5_/i, "/docs/Web/JavaScript/", {
permanent: true,
// This will convert :
// /en-US/docs/Core_JavaScript_1.5_Reference:Statements:block
// to:
// /en-US/docs/Core_JavaScript_1.5_Reference/Statements/block
// It's needed because back in the day when this prefix was used a
// there are a lot of old URLs that delimited with a `:` instead of a `/`
// which is what we use today.
colonToSlash: true,
}),

And indeed, while /en-US/Core_JavaScript_1.5_Guide does NOT redirect (due to the missing /docs/ part), /en-US/docs/Core_JavaScript_1.5_Guide does redirect to /en-US/docs/Web/JavaScript/Guide/, except that this specific page (and the whole "Exception Handling Statements" area) was moved into a section of Web/JavaScript/Guide/Control_flow_and_error_handling.

@alexander-schranz If you like, you could try and open a PR in mdn/content to add the following redirects to the _redirects.txt, but I cannot guarantee that they would be accepted:

/en-US/docs/Web/JavaScript/Guide/Exception_Handling_Statements /en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#exception_handling_statements
/en-US/docs/Web/JavaScript/Guide/Exception_Handling_Statements/throw_Statement /en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#exception_handling_statements
/en-US/docs/Web/JavaScript/Guide/Exception_Handling_Statements/try...catch_Statement /en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#exception_handling_statements

Not sure where but for example stackoverflow answers link to it: https://stackoverflow.com/questions/5963045/can-syntax-errors-be-caught-in-javascript.

This StackOverflow post links to /en-US/Core_JavaScript_1.5_Guide/Statements#try...catch_Statement, and the redirect would work if the URL had /docs/ in it. I believe StackOverflow users with enough reputation could actually update the links in the answer.

I found my general issue the links on caniuse are directed based on my Accept-Language: de which ends on 404 pages:

This is a separate issue, see e.g.:

I have also run into this with /community if used without a locale. https://developer.mozilla.org/community is a 404 but https://developer.mozilla.org/en-US/community is fine

I think only /docs/* without a locale get redirected to /{locale}/docs/* though, but we could look into redirecting meta pages as well.

@alexander-schranz
Copy link
Author

I think the main problem is that not all pages are translated so example https://developer.mozilla.org/docs/Web/CSS/aspect-ratio redirect me to https://developer.mozilla.org/de/docs/Web/CSS/aspect-ratio.

So the strategy would need to be implemented there. If the page does not exist in the "target locale" it should not redirect to a 404 page.

There are 2 possibilites. Show default locale / english content on https://developer.mozilla.org/de/docs/Web/CSS/aspect-ratio or do a redirect to /en/... instead of /de/....

@caugner
Copy link
Contributor

caugner commented Aug 23, 2022

I think the main problem is that not all pages are translated so example https://developer.mozilla.org/docs/Web/CSS/aspect-ratio redirect me to https://developer.mozilla.org/de/docs/Web/CSS/aspect-ratio.

In that case, you do already get a message "The page you requested doesn't exist in German but it exists in English":
image

Note that the German locale will be archived in the next few weeks, so from that moment on there will be a redirect to en-US, like already in place for other retired locales: https://developer.mozilla.org/tr/docs/Web/CSS/aspect-ratio

@caugner caugner added p3 We don't have visibility when this will be addressed. redirects all things related to redirecting and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 We don't have visibility when this will be addressed. redirects all things related to redirecting
Projects
Development

Successfully merging a pull request may close this issue.

5 participants