Skip to content

Draft: POC wiki redirections file

What does this MR do?

This MR is a POC of an idea I just had.

At the moment, when we change the title of a wiki page, the slug changes. This means that the old slug no longer works. I've thought about creating a special file in the repository where users could introduce their broken redirections or even add new ones there.

The special file is called _redirections and the redirection has the format:

old_page1 -> new_page
old_page2 -> other_page

Disclaimer: the format is just a random one I chose just for this idea.

I know that a structured format like yaml would made this easier but if we want users to edit it, the file should have one of the allowed formats.

So now, when we access a page, we will check if the page exists and, if not, we'll check for the redirection.

It's not very efficient because the routes are parsed on each request when the page does not exists, but we could come up with some sort of Redis caching (although I'm not very fond of keeping this in memory either).

This MR is just to validate this idea and get some feedback.

I know that in the future we want to track this using the wiki meta information but, in the meantime, we can help some customers with this feature. We could also switch from a file to a custom form in the page where we could say which page links should redirect to that page.

Refs #325258

Does this MR meet the acceptance criteria?

Conformity

Merge request reports