Redirects
We use Cloudflare’s Bulk Redirect to map URLs that moved to their new location, so the user does not get a 404 using the old link.
Redirects are recorded in unionai-docs-infra/redirects.csv, one per line, in CSV format:
<source_url>,<target_url>,<status>,<include_subdomains>,<subpath_matching>,<preserve_query_string>,<preserve_path_suffix>
| Column | Meaning |
|---|---|
source_url |
the incoming URL, without https:// |
target_url |
the full URL to send the user to, including https:// |
status |
301 for a permanent move, which is what new rows normally use |
include_subdomains |
TRUE / FALSE |
subpath_matching |
TRUE matches everything beneath the source path |
preserve_query_string |
TRUE keeps ?a=b on the target |
preserve_path_suffix |
TRUE appends the matched subpath to the target. Cloudflare rejects this unless subpath_matching is also TRUE |
A real row:
docs.union.ai/administration,https://www.union.ai/docs/v2/union/user-guide/user-management,301,TRUE,TRUE,TRUE,TRUEDeployment is automatic. Merging your change is enough. The deploy-redirects.yml workflow
pushes the whole list to Cloudflare on any push to main or v1 that touches the infra pointer
or versions.toml. Nobody has to apply it by hand.
To add a redirect, open a pull request changing redirects.csv. Two rules save review time:
- Point at the page that actually serves, not at a URL you know will redirect again. Chains are trimmed periodically and a new one undoes that work.
- Mind the trailing slash. An exact-match row misses the other form and produces a soft 404.
Either set
subpath_matchingtoTRUEor add both/xand/x/.
Do not add rows for retired version pins. When a pinned version is retired its redirect is
derived automatically from the retired list in that line’s versions.toml. A test fails if a
row for one appears in the CSV.
This file cannot express patterns. It becomes a Cloudflare Bulk Redirect List, which has no
regular expressions and no capture groups. A redirect that needs a pattern (for example, mapping
every <path>/old.md to <path>.md) is a dynamic redirect rule, edited in the Cloudflare
dashboard rather than here.
docs.union.ai redirects
For redirects from the old docs.union.ai site to the new www.union.ai/docs site, we use the original request URL. For example:
| Request URL | https://docs.union.ai/administration |
| Target URL | https://www.union.ai/docs/v1/union/user-guide/administration |
| Redirect Entry | docs.union.ai/administration,https://www.union.ai/docs/v1/union/user-guide/administration,302,TRUE,FALSE,TRUE,TRUE |
docs.flyte.org redirects
For directs from the old docs.flyte.org to the new www.union.ai/docs, we replace the docs.flyte.org in the request URL with the special prefix www.union.ai/_r_/flyte. For example:
| Request URL | https://docs.flyte.org/projects/flytekit/en/latest/generated/flytekit.dynamic.html |
| Converted request URL | www.union.ai/_r_/flyte/projects/flytekit/en/latest/generated/flytekit.dynamic.html |
| Target URL | https://www.union.ai/docs/v1/flyte/api-reference/flytekit-sdk/packages/flytekit.core.dynamic_workflow_task/ |
| Redirect Entry | www.union.ai/_r_/flyte/projects/flytekit/en/latest/generated/flytekit.dynamic.html,https://www.union.ai/docs/v1/flyte/api-reference/flytekit-sdk/packages/flytekit.core.dynamic_workflow_task/,302,TRUE,FALSE,TRUE,TRUE |
The special prefix is used so that we can include both docs.union.ai and docs.flyte.org redirects in the same file and apply them on the same domain (www.union.ai).