More and more links are running into a 404
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
- [X] I have read the Community Participation Guidelines.
- [X] I have verified that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] I have checked that this is a concrete bug. For Q&A open a GitHub Discussion.
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?
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 😄
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.
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
I found my general issue the links on caniuse are directed based on my Accept-Language: de which ends on 404 pages:
-
https://developer.mozilla.org/docs/Web/CSS/aspect-ratio -> https://developer.mozilla.org/de/docs/Web/CSS/aspect-ratio
-
Found on: https://caniuse.com/mdn-css_properties_aspect-ratio
-
https://developer.mozilla.org/docs/Web/API/ImageBitmap/width -> https://developer.mozilla.org/de/docs/Web/API/ImageBitmap/width
-
Found on: https://caniuse.com/mdn-api_imagebitmap_width
-
https://developer.mozilla.org/docs/Web/CSS/flex-direction -> https://developer.mozilla.org/de/docs/Web/CSS/flex-direction
-
Found on: https://caniuse.com/mdn-css_properties_flex-direction
Personally prefer english docs so I would be fine with a none language specific redirect here :). But thats just me.
@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
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 https://github.com/mdn/content/pull/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 https://github.com/mdn/yari/pull/2698. And they still seem to be (except that they require the /docs/ part in the url):
https://github.com/mdn/yari/blob/3c9d149aef2a4d6c747ab1f4e55a321e36d48a89/libs/fundamental-redirects/index.js#L1215-L1225
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.:
- https://github.com/mdn/yari/issues/275
- https://github.com/mdn/yari/issues/2724
I have also run into this with
/communityif used without alocale. 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.
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/....
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":

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