-
Notifications
You must be signed in to change notification settings - Fork 518
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
Fix "Page not found" suggested search path #8822
Comments
@harrisi Would you have another example? For me, the URL you mention redirects to
|
Interesting. I just tried this with curl and Chrome and I do indeed get redirected to the proper It seems the issue is that I'm logged into MDN Plus on Firefox. I'll look into that more. |
Do you have MDN Offline enabled by any chance? |
Yes, which does seem to be the issue. That seems like a big enough difference in cause to warrant a new issue. |
@harrisi This seems to have been fixed with #8846, I can not reproduce it (with MDN Offline enabled). Would you mind trying it again? (I tested with https://developer.mozilla.org/docs/Web/HTML/Quirks) |
I'm still seeing this. I tried clearing my cache and getting rid of any local storage, redownloading, and testing again. Tried in a different browser, in private mode, still seeing the issue. Interestingly, if I sign in in a Safari private window, turn on offline content, and before even downloading the content, navigate to https://developer.mozilla.org/docs/Web/HTML/Quirks_Mode_and_Standards_Mode, I see the issue. If I turn off offline content and go to the address again, it redirects correctly. I'm still not sure how to even effectively recreate this locally, actually. Any tips on mocking a signed in user, using local storage rather than local web server, etc. would be appreciated. |
Thank you for the update. Can you explain how you navigate to https://developer.mozilla.org/docs/Web/HTML/Quirks_Mode_and_Standards_Mode in the first place (and not https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode, which would work)? |
|
Added |
Summary
When a page is not found, a "Page not found" page is served, with a section for suggested search terms by generating links to
window.location.pathname.split('/').map(el => `https://developer.mozilla.org/${window.location.pathname.split('/')[1]}/search?q=${el}`).splice(2)
(this is obviously not how it's actually done on the server, but just to show what's happening). This is includes the top-most level of the path, which either shouldn't be included in the links generated, as it causes the path to be something likehttps://developer.mozilla.org/docs/search?q=Quirks%20Mode%20and%20Standards%20Mode
, withdocs
included, whereas the search path is just/search
(i.e., top-level).URL
https://developer.mozilla.org/docs/Web/HTML/Quirks_Mode_and_Standards_Mode
Reproduction steps
Expected behavior
Should navigate to https://developer.mozilla.org/en-US/search?q=Quirks%20Mode%20and%20Standards%20Mode
Actual behavior
Navigates to https://developer.mozilla.org/en-US/docs/search?q=Quirks%20Mode%20and%20Standards%20Mode
Device
Desktop
Browser
Firefox
Browser version
Stable
Operating system
Mac OS
Screenshot
No response
Anything else?
No response
Validations
The text was updated successfully, but these errors were encountered: