Redirect missing translations to the English page - #4008
Merged
Merged
Conversation
The hand-written list still had the old `ua` code, so a missing page under /uk/ stayed on the English 404 page instead of /uk/404.html. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vi has no 404 page, so /vi/404.html is answered with the root 404 page, whose script redirected to /vi/404.html again without end. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A page or news post that has not been translated returned the language's 404 page, although the English original exists. GitHub Pages serves the root 404 page for every missing URL, so check the English URL from there instead of copying English pages into each language. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying www-ruby-lang-org with
|
| Latest commit: |
64ba76a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1d662aa4.www-ruby-lang-org.pages.dev |
| Branch Preview URL: | https://claude-awesome-murdock-7707b.www-ruby-lang-org.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a page or news post has no translation, such as
/de/news/2026/09/15/ruby-4-0-7-released/, visitors get a 404 although the English page exists. The 404 script also had two bugs. Its hand-written language list still hadua, so missing/uk/pages stayed on the English 404. And/vi/404.htmldoes not exist, so missing/vi/pages reloaded it endlessly.GitHub Pages serves the root
404.htmlfor every missing URL, so I handle it there. The script sends aHEADrequest for the same path under/en/and moves there withlocation.replaceif it exists, or to/<lang>/404.htmlotherwise. It does nothing when it is already on/<lang>/404.html, which rules out the loop. The language list now comes fromsite.data.languages.Unlike #3757, no English pages are copied into language directories.
Generated with Claude Code