Skip to content

Fix regex (~ operator) type redirects

Marcel Amirault requested to merge update-broken-redirects into master

Why is this change being made?

While researching how to fix the issues in !111876 (merged), I noticed that there were other areas in the redirects file that do not follow the guidelines from https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/redirects_on_about_gitlab_com.md#regex-: When using `~` use a single source URL with a closing slash.

Duplicating URLs (like you might do with the = operator) causes redirects to break. For example:

In cases where the first source does not end with a slash, the redirects are broken, for example -> https://about.gitlab.com/direction/memory :

- sources:
  - /direction/memory  # <- Breaks redirects
  - /direction/memory/
  target: /direction/application_performance/
  comp_op: '~'

In cases where the first source ends with a slash, the redirects don't break, but the second entry doesn't actually do anything:

- sources:
    - /culture/
    - /culture  # <- Not needed
  target: /company/culture/
  comp_op: '~'

Author Checklist

  • Provided a concise title for this Merge Request (MR)
  • Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
    • Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added.
  • Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI)
    • If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the Maintained by section on the page being edited
    • If your manager does not have merge rights, please ask someone to merge it AFTER it has been approved by your manager in #mr-buddies
  • If the changes affect team members, or warrant an announcement in another way, please consider posting an update in #whats-happening-at-gitlab linking to this MR
    • If this is a change that directly impacts the majority of global team members, it should be a candidate for #company-fyi. Please work with internal communications and check the handbook for examples.

Edited by Marcel Amirault

Merge request reports

Loading