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

Add fallback redirects for requests that don't include a language path #1374

Closed
samajammin opened this issue Aug 26, 2020 · 4 comments
Closed
Assignees
Labels
feature ✨ This is enhancing something existing or creating something new Status: Blocked 🛑 This is blocked

Comments

@samajammin
Copy link
Contributor

samajammin commented Aug 26, 2020

Is your feature request related to a problem? Please describe.

Requests to pages without a language path (e.g. https://ethereum.org/eth2) currently 404.

I imagine it's easy to forget the language path when linking to pages. I myself just did this (& I build the darn site):

Describe the solution you'd like

  • Come up with a way to automatically redirect pages to English equivalent if the requested page doesn't exist
  • Ideally this accomplished using a redirect rule in our netlify.toml (docs here)

Describe alternatives you've considered

Additional context
I tried the automatic route using our intl plugin but it lead to this issue: #1347
Note: this approach may become a valid solution again once we roll out every page for every language!

Docs on redirects using netlify.toml: https://docs.netlify.com/configure-builds/file-based-configuration/#redirects

@samajammin samajammin added the feature ✨ This is enhancing something existing or creating something new label Aug 26, 2020
@samajammin
Copy link
Contributor Author

@ryancreatescopy curious to hear your thoughts on this - is site search an adequate solution? Or would some additional copy be helpful here?

@ryancreatescopy
Copy link
Contributor

I think content is a bit of a band-aid to this problem but it couldn't hurt to add a suggestion here to check the language path (providing we think the user knows what their language path is). Ideally, I'd like us to pursue the automatic redirect or even better redirect to a language based on something else like browser language or something else that could help us make a best guess about what language the user might want (fallback being English with a toast(?) that explains the page isn't available in their desired language)

@samajammin samajammin changed the title Improve 404 page Add fallback redirects for requests that don't include a language path Sep 29, 2020
samajammin added a commit that referenced this issue Oct 8, 2020
Add fallback redirect to /en/ [Fixes #1374]
@samajammin
Copy link
Contributor Author

samajammin commented Nov 12, 2020

This is still an issue.

My solution to add a broad redirect in netlify.toml (https://github.com/ethereum/ethereum-org-website/pull/1536/files) hit this issue: netlify/cli#1299 (additional files, not just HTML files, we're redirecting immediately instead of falling back to redirect if resource was not found).

@samajammin samajammin reopened this Nov 12, 2020
@samajammin samajammin self-assigned this Dec 7, 2020
@samajammin
Copy link
Contributor Author

Once we roll out every page for every language (#2072), we'll be able to solve this via the redirect config option in our intl plugin: https://github.com/wiziple/gatsby-plugin-intl

@samajammin samajammin added the Status: Blocked 🛑 This is blocked label Dec 7, 2020
samajammin added a commit that referenced this issue Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ✨ This is enhancing something existing or creating something new Status: Blocked 🛑 This is blocked
Projects
None yet
Development

No branches or pull requests

2 participants