Salvage 404s that are 404s because of lack of /docs/
See original GitHub issueTake https://developer.mozilla.org/en-US/DOM/element.addEventListener for example. It came up in https://github.com/mdn/content/issues/2073
What ought to happen is that the fundamental redirects should have…
/en-US/DOM/(*) --> /en-US/docs/DOM/$1
but that list is very long. As of today, it’s basically anything where the word after the locale isn’t search
or settings
or sign-up
or whatever we come up with next.
A simple fix would at least be to make the 404 page a bit more useful. A piece of async XHR could do something like:
// pseudo-code
if (VALID_LOCALES.has(currentLocale) && location.pathname.split('/')[1] !== 'docs') {
const tryURL = location.pathname.split('/').splice(1, 0, 'docs').join('/') + '/index.json'
const r = await fetch(tryURL)
if (r.ok) {
showGoodNews(r.url)
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Do 404 errors hurt my site? | Google Search Central Blog
A: A soft 404 is when a web server returns a response code other than 404 (or 410 ) for a URL that...
Read more >404 vs. Soft 404 Errors: What's The Difference & How To Fix ...
404 and soft 404s are different kinds of problems that require different approaches to diagnosing and fixing them.
Read more >How to Find and Fix 404 Errors - Neil Patel
In this post, I'll cover everything you need to know about 404s, why they are bad for business, how to find them, and...
Read more >How To Find & Fix 404 Errors On Your Website | Matthew Edgar
You need to check 404 errors on your website regularly because not-found errors create a bad user experience that causes people to leave ......
Read more >What Are Google Soft 404 Errors (and How to Fix Them)
They're also a strange error because soft 404s are a hybrid of 404 and normal pages, and what exactly is causing this error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I looked again, in Google Analytics. We have virtually no 404s that could easily be fixed with a redirect (that injects
/docs/
after the locale).@escattone Can you tie your PR to this issue that adds it to the fundamental redirects?