Repository navigation
Add redirect domains - #175
Merged
Merged
Conversation
A team can add hosts that only 301-redirect to its website, so links to an old address (e.g. a previous docs host) keep working after a move. Each redirect domain has a path prefix and exact-path rules, proves ownership with its own TXT token plus the usual routing record, and only redirects once both pass. Available over REST, MCP and the Domain page. Closes #82
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.
Closes #82.
What
A team can add redirect domains: hosts that serve nothing and 301-redirect every request to the website's canonical host. This keeps links to an old address working after a move, e.g.
docs.medialit.cloud→medialit.cloud/docs./docs,docs.example.com/cli?x=1→example.com/docs/cli?x=1, and/→/docs./api/uploadMedia→/docs/api/upload-media. The request query is kept unless the rule has its own. Rules are stored on the redirect domain, not insite.json, so teams that build pages in the builder can use them too.TXT _frontlit-verify.<host>token plus the usual CNAME/A routing record, so it can live in any zone. It only redirects once both pass. TLS certificates come from the existing/public/tls-askgate, which now approves verified redirect domains.Where
redirect_domainstable (migration0013),POST /domain/redirect-domains,PATCH/DELETE /domain/redirect-domains/:hostname,POST /domain/redirect-domains/:hostname/verify.GET /domainlists them.resolve-hostreturnsredirectTo { pathPrefix, rules }for a redirect domain.add_redirect_domain,update_redirect_domain,verify_redirect_domain,remove_redirect_domain(add and remove are high impact).decideHostbuilds the target path fromredirectTo./old /newper line).docs/architecture.md§12.1/§12.2 and the REST/MCP matrix are updated.Testing
decideHost(prefix, rules, query handling, root path).curland the browser followed 301s for prefix paths, rules and/.