-
Notifications
You must be signed in to change notification settings - Fork 114
Add images and example for versioned redirects #1477
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
base: main
Are you sure you want to change the base?
Conversation
Vercel Previews Deployed
|
|
|
||
| ## 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! |
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.
| 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
|
|
||
|  | ||
|
|
||
| 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). |
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.
| 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: |
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.
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>`). |
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.
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. |
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.
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"
|
|
||
|  | ||
|
|
||
| To properly cover this URL change, you need three redirects: |
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.
| 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
|  | ||
|
|
||
| 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. |
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.
| 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`. |
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.
| 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`. |
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.
| 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: |
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.
| 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"?
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 🔍