Skip to content

Remove unneeded redirect

Sarah German requested to merge sarahg/archives-redirect-online into main

What does this MR do and why?

Fixes a bug with Archives redirect logic.

We want to redirect to the Archives site under these conditions:

  1. The path includes a version that's included on archives.docs.gitlab.com
  2. The version in the path is not a version included on docs.gitlab.com

Because we include the last release of the last two majors (13.12 and 14.10 currently) on both sites, we have a bug where hitting a 404 in 13.12 or 14.10 redirects you to a 404 on the Archives site.

Expected behavior

Visiting a page that doesn't exist and is from an online previous major returns a 404 on docs.gitlab.com.

Actual behavior

Visiting a page that doesn't exist and is from an online previous major redirects to a 404 on archives.docs.gitlab.com.

Example: https://docs.gitlab.com/13.12/updog

--

This MR fixes the bug, giving us the expected behavior.

Related: !3320 (merged)

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Follow the directions here to run the site on an nginx web server: !3320 (merged) (required to serve the custom 404 page)
  3. Verify that hitting a 404 on 14.10 or 13.12 does not redirect (e.g http://localhost:8080/14.10/asdf)

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports