Skip to content

Preserve the path when redirecting the latest version#923

Closed
peterguy wants to merge 1 commit intomainfrom
peterguy/fix-redirect-with-latest-version
Closed

Preserve the path when redirecting the latest version#923
peterguy wants to merge 1 commit intomainfrom
peterguy/fix-redirect-with-latest-version

Conversation

@peterguy
Copy link
Contributor

@peterguy peterguy commented Jan 24, 2025

When redirecting links that contain the latest version in the path, only the slug was being preserved, and the redirect was going to sourcegraph.com.

Change that to preserve the whole path (except the version), and to preserve the current host.

For example:

http://localhost:3000/docs/v/5.11/code_search/reference/queries should redirect to /docs/code_search/reference/queries, which should finally redirect to /docs/code-search/queries

Behavior of /@5.11/ should be the same as /v/5.11/.

@vercel
Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sourcegraph-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 9:52pm

@peterguy
Copy link
Contributor Author

Fixed elsewhere

@peterguy peterguy closed this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant