Skip to content

Conversation

@rkoron007
Copy link
Contributor

@rkoron007 rkoron007 commented Dec 5, 2025

Adding images and an example for the redirects file based on my 404 ramblings! I'll eventually make more updates when I'm down with the script, but wanted to add these for now!

You can see the rendered file here 🔍

@rkoron007 rkoron007 self-assigned this Dec 5, 2025
@rkoron007 rkoron007 requested review from a team as code owners December 5, 2025 23:25
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Vercel Previews Deployed

Name Status Preview Updated (UTC)
Dev Portal ✅ Ready (Inspect) Visit Preview Mon Dec 8 22:29:48 UTC 2025
Unified Docs API ✅ Ready (Inspect) Visit Preview Mon Dec 8 22:25:33 UTC 2025


## Background

If you move an existing article in the documentation, you **must** add redirects. Otherwise, links break between versions and users can't find the information they are looking for, even if it exists in the version they are viewing!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you move an existing article in the documentation, you **must** add redirects. Otherwise, links break between versions and users can't find the information they are looking for, even if it exists in the version they are viewing!
If you move an existing article in the documentation, you **must** add redirects. Otherwise, links break between versions and users cannot find the information they are looking for, even if it exists in the version they are viewing.

Style correction: avoid contractions, avoid exclamations


![Diagram showing a single path change and a single redirect](../images/single_redirect_diagram.png)

This redirect ensures any requests to the old URL properly re-route to the new URL. To learn more, refer to [Example redirects](#example-redirects).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This redirect ensures any requests to the old URL properly re-route to the new URL. To learn more, refer to [Example redirects](#example-redirects).
The single redirect ensures any requests to the old URL properly re-route to the new URL. To learn more, refer to [Example redirects](#example-redirects).

Style correction: avoid "this" as a pronoun


This redirect ensures any requests to the old URL properly re-route to the new URL. To learn more, refer to [Example redirects](#example-redirects).

If your product **is** versioned, add **three** redirects to reroute requests to the appropriate path in each version:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, I think you can get away with 2 redirects: one for the "latest" form of the URL (which doesn't have a version tag) and one for versioned URLs. 🤔


The three redirects cover the following use cases:
1. Redirects the latest version URL, which has no version path (i.e., `/product/<path>`).
2. Redirects older versions to the old path (i.e., `/product/:version/<old_path>`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth being explicit that your mapping the new path to the old path and noting that these redirects are needed explicitly for the version selector. Otherwise it kind of reads like you're creating redirects for old paths that haven't changed.


Refer to [Versioned redirects](#versioned-redirects) for a full example.

We also recommend that you replace references to the old URL with the new URL in your documentation text.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true regardless of whether your content is versioned. I'd suggest adding this to the very beginning in the vein of: "In addition to changing in-content references when a UR changes blah blah blah"


![Diagram showing example of versioned redirects](../images/versioned_redirects_example.png)

To properly cover this URL change, you need three redirects:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To properly cover this URL change, you need three redirects:
To properly cover the change to `terraform/concepts/state`, you need three redirects:

Style correction: avoid "this" as a pronoun

![Diagram showing example of versioned redirects](../images/versioned_redirects_example.png)

To properly cover this URL change, you need three redirects:
1. The first redirect is for the latest version, you want `/terraform/state` to redirect to the new `/terraform/state/concepts` URL.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The first redirect is for the latest version, you want `/terraform/state` to redirect to the new `/terraform/state/concepts` URL.
1. A redirect for the latest version to map `/terraform/state` to the new
`/terraform/state/concepts` URL.

Style suggestion: avoid repeating "first" etc. in a list that's already numbered, shorten the list item to highlight the actual mapping.


To properly cover this URL change, you need three redirects:
1. The first redirect is for the latest version, you want `/terraform/state` to redirect to the new `/terraform/state/concepts` URL.
1. The second redirect is backward-facing. In v1.9.x and below, you want users to land on the original URL `/terraform/<v1.9.x_and_below>/state`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The second redirect is backward-facing. In v1.9.x and below, you want users to land on the original URL `/terraform/<v1.9.x_and_below>/state`.
1. A backward-facing redirect to map URLs for v1.9.x and below so users land on
the original URL: `/terraform/<v1.9.x_and_below>/state`.

Style suggestion: same as (1)

To properly cover this URL change, you need three redirects:
1. The first redirect is for the latest version, you want `/terraform/state` to redirect to the new `/terraform/state/concepts` URL.
1. The second redirect is backward-facing. In v1.9.x and below, you want users to land on the original URL `/terraform/<v1.9.x_and_below>/state`.
1. The third redirect is forward-facing. In v1.10.x and above, you want users to land on the new URL `/terraform/<v1.10.x_and_above>/concepts/state`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The third redirect is forward-facing. In v1.10.x and above, you want users to land on the new URL `/terraform/<v1.10.x_and_above>/concepts/state`.
1. A forward-facing redirect to map URLs for v1.10.x and above so users land on
the new URL `/terraform/<v1.10.x_and_above>/concepts/state`.

Style suggestion: same as (1)

1. The second redirect is backward-facing. In v1.9.x and below, you want users to land on the original URL `/terraform/<v1.9.x_and_below>/state`.
1. The third redirect is forward-facing. In v1.10.x and above, you want users to land on the new URL `/terraform/<v1.10.x_and_above>/concepts/state`.

The following redirects would handle all of the changes between versions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following redirects would handle all of the changes between versions:
The following redirects handle all the redirect situations as users change
between content versions:

I think this is what you meant by "changes between versions"?

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.

2 participants