Add a temporary URL rewrite for search result URLs
What does this MR do and why?
Last step for #21 (closed)
Because Google is indexing our production site, docs.gitlab.com, it returns result URLs for those pages. For now, we need to rewrite these when we get the results back from Google so that they work on the new site.
This means we need to:
- drop the "ee" prefix
- add
.html
to URLs that end in a/
This MR also includes:
- Refactor for other migration-related frontend logic. Keeping it all in one spot should make it easier to remove later.
- Redirect from the old test domain to the new one with JS. The old test domain isn't going to work quite right now that we've switched to
new.docs.gitlab.com
, but there are many links to it from our older MRs that people might still refer to during this project.
Screenshots, screen recordings, or links to review app
n/a
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
Run a few searches and verify that the links take you to the expected pages.
Post-merge, we can check the domain-level redirect to new.docs.gitlab.com
.
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German