-
Notifications
You must be signed in to change notification settings - Fork 7
Fix redirects: add /en/ prefix to all redirect sources and destinations #630
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
Conversation
- Added /en/ locale prefix to all redirect sources and destinations - Removed duplicate redirects and trailing slash redirects - Ensures URLs like /en/home/build-tools/create-a-mcp-server redirect properly - Total of 59 clean redirects with proper /en/ prefix 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Passing my review to @sdserranog - I thought the |
|
Yeah, the prefix should be added automatically. I think there's no need to add it; I'm curious why we're doing it. Regarding the functions we added to fix the links for integration, we should remove those. I updated the design system links, and we just need to upgrade the design system version to get the correct link. |
|
So I thought the same. But apparently for 301 redirects, they need the whole path. That was why the redirect from the dashboard wasn't working. I think. I'm happy if you want to take this on and test the redirects, @sdserranog. I'm out of steam. |
|
@nearestnabors I can take this one if it's okay for me to do it first thing tomorrow. I need to step up for today. |
|
|
||
| // Return original link if it doesn't match the pattern | ||
| return oldLink; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapToNewIA regex requires /en/ prefix that may be absent
The mapToNewIA function's regex pattern ^\/en\/mcp-servers\/... requires the input link to start with /en/mcp-servers/. Based on the PR discussion, the design system likely provides relativeDocsLink values without the /en/ locale prefix since "the prefix should be added automatically." If the design system returns paths like /mcp-servers/productivity/gmail, the regex won't match and the original (potentially broken) link will be returned unchanged. The pattern may need to handle links both with and without the locale prefix.
Summary
/en/locale prefix to all redirect sources and destinations/en/home/build-tools/create-a-mcp-serverredirect properly to/en/guides/create-tools/tool-basics/build-mcp-serverChanges Made
/en/prefixTesting
/en/locale prefix on all sources and destinationsImpact
This fixes 404 issues for internationalized URLs that weren't properly redirecting due to missing locale prefixes.
🤖 Generated with Claude Code
Note
Updates site routing to the new information architecture and localized URLs.
/:locale/*redirects innext.config.ts(home → guides/resources, MCP servers → resources/integrations, reference/path fixes, and framework alias paths)toolkits.tsx(/en/mcp-servers/{category}/{tool}) to/en/resources/integrations/{category}/{tool}/referencefindToolkitFromPathintoolkit-utils.tsto resolve toolkits from both/resources/integrations/{category}/{tool}and/.../referenceremark-glossaryto skip glossary auto-linking on/resources/integrations/*pagesWritten by Cursor Bugbot for commit 6f5140e. This will update automatically on new commits. Configure here.