Skip to content

Commit

Permalink
Include redirecting specific versions of articles to other URLs in re…
Browse files Browse the repository at this point in the history
…directs docs (#49098)
  • Loading branch information
ethanpalm authored Feb 8, 2024
1 parent 3ccfd8d commit 45fb432
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit 45fb432

Please sign in to comment.