Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Topic Redirects

Leslie Tilling edited this page Jun 22, 2021 · 1 revision

If you need to rename, move, or delete a topic page, you must include a redirect so that any existing links from outside of the user guide site will not result in a 404. Depending on the situation, add a redirect to the front matter of page that will be the new destination:

  • For a deleted page, add the redirect using the current URL to an alternative page. This could be a page up in the current navigation or a page where you have transferred some or all of the content for the deleted page.
  • For a renamed or moved page, add the redirect to that same page using the current URL.

Examples

As an example, when removing the src/marketing/blogs.md topic file, you would take it out of the navigation .yml file, update any internal links from other topics, add the redirect to the page you want to load if a user were to try to access the URL for the removed page:

---
title: Promotional Content
redirect_from:
  - /marketing/blogs.html
---

As another example, when renaming or moving (essentially a rename at the path level) a topic file, you would make sure to update the yml file for the navigation, update any internal links from other topics, and add the redirect to the file. If src/marketing/blogs.md is moving to src/content/marketing-blogs.md, you would add the redirect for the old file name/path:

---
title: Marketing Blogs
redirect_from:
  - /marketing/blogs.html
---