A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.gitlab.com/development/documentation/redirects/ below:

Redirects in GitLab documentation | GitLab Docs

When you move, rename, or delete a page, you must add a redirect. Redirects reduce how often users get 404s when they visit the documentation site from out-of-date links.

Add a redirect to ensure:

Be sure to assign a technical writer to any merge request that moves, renames, or deletes a page. Technical Writers can help with any questions and can review your change.

When you change the filename of a page, the Google Analytics are removed from the content audit and the page views start from scratch. If you want to change the filename, edit the page first, so you can ensure the new page name is as accurate as possible.

Types of redirects

There are two types of redirects:

Expired redirect files are removed from the documentation projects as part of the Technical Writing team’s monthly tasks.

Redirect to a page that already exists

To redirect a page to another page in the same repository:

  1. In the Markdown file that you want to direct to a new location:

  2. If the page had images that aren’t used on any other pages, delete them.

Update links in other repositories

After your changes are committed, search for and update all other repositories that might link to the old file:

  1. In https://gitlab.com/gitlab-com/www-gitlab-com, search for full URLs:

    grep -r "docs.gitlab.com/path/to/file" .
  2. In https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/tree/main/data, search the navigation bar configuration files for the path:

  3. In all of the doc projects, search for links in the docs and codebase. Search for all variations, including full URL and just the path. For example, go to the root directory of the gitlab project and run:

    grep -r "docs.gitlab.com/path/to/file" .
    grep -r "path/to/file" .
    grep -r "path/to/file.md" .
    grep -r "path/to/file" .

    You might need to try variations of relative links, such as ../path/to/file or ../file to find every case.

  4. In https://gitlab.com/gitlab-org/customers-gitlab-com, search for full URLs:

    grep -r "docs.gitlab.com/path/to/file" .
Move a file’s location

If you want to move a file from one location to another, you do not move it. Instead, you duplicate the file, and add the redirect code to the old file.

  1. Create the new file.
  2. Copy the contents of the old file to the new one.
  3. In the old file, delete all the content.
  4. In the old file, add the redirect code and follow the rest of the steps in the Redirect to a page that already exists topic.
Use code to add a redirect

If you prefer to use a script to create the redirect:

Add the redirect code to the old documentation file by running the following Rake task. The first argument is the path of the old file, and the second argument is the path of the new file:

Redirecting a page created before the release

If you create a new page and then rename it before it’s added to a release on the 18th:

Instead of following that procedure, ask a Technical Writer to manually add the redirect to redirects.yaml.

Exceptions to creating a redirect

In some cases you can skip adding the redirect and just delete the file. The page must have already been removed from (or never existed in) the navigation, and one of the following must be true:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4