1
0
mirror of synced 2025-12-25 02:17:36 -05:00

Include redirecting specific versions of articles to other URLs in redirects docs (#49098)

This commit is contained in:
Ethan Palm
2024-02-08 08:19:21 -08:00
committed by GitHub
parent 3ccfd8da92
commit 45fb4321f3

View File

@@ -20,7 +20,7 @@ Within the {% data variables.product.prodname_docs %}, you can redirect from one
### Redirects across files
If you change the name of an article and want its old URL to redirect to its new URL, use the `redirect_from` frontmatter with the path to the article's old name.
If you change the name of an article and want its old URL to redirect to its new URL for all versions, use the `redirect_from` frontmatter with the path to the article's old name. If you change the name of an article and want different versions to redirect to different URLs, follow the steps in the "[Redirects across versions](#redirects-across-versions)" section.
In the following example, the article "All about commits" was renamed to "Creating your first commit." The `redirect_from` frontmatter redirects anyone who navigates to the old article URL to the new article URL.
@@ -48,7 +48,7 @@ If `ARTICLE` is available in Free, Pro, or Team, no redirect will occur because
### Redirects across versions
If you want the URL for one version of an article to redirect to a URL for another version, you must update the [redirect-exceptions.txt](https://github.com/github/docs/blob/main/src/redirects/lib/static/redirect-exceptions.txt) file in the `src/redirects` directory.
If you want the URL for one version of an article to redirect to a URL for another version or to another URL entirely, you must update the [redirect-exceptions.txt](https://github.com/github/docs/blob/main/src/redirects/lib/static/redirect-exceptions.txt) file in the `src/redirects` directory.
For example, if you remove the Free, Pro, or Team (`fpt`) version of an article, the URL will automatically redirect to the next available version of the page. If you want it to redirect to a version that is lower in the order of precedence, or to a different page entirely, you must specify an exception.