Skip to content

More useful 404 (e.g. for relocations) #40

@janbrasna

Description

@janbrasna

So there might be bookmarks, permalinks in readmes, or search results pointing to pages that then get moved around, gaining fresh URLs in their brand new structure … however leaving behind broken 404s that no longer serve anything at the former location.

It doesn't seem like mkdocs has any built in way to handle these, or a simple config to map redirections IIUC, but things mentioned are:

I also was considering just making the 404 a little bit more helpful in directing towards the right page:

Basically a 404 like this: https://mozmeao.github.io/platform-docs/install/#documentation is kinda unhelpful, but all it takes is just parse the original URL and trigger a search with it, and magically: https://mozmeao.github.io/platform-docs/install/?q=install+documentation that's all you might need at that point. Maybe the cheapest thing would be tweaking the 404 template to just redirect to itself with the search pane open with the results parsed from path? (Or maybe there's a good JS hook to trigger from within the page that search UI already primed with content?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions