Multiple version documentation redirect from latest

Hello,
I have a website that contains multiple versions of documentation for some applications and I want to be able to have an alias/redirect that would allow our users to be redirected from /docs/latest/some-page to /docs/v1.0.0/some-page.
This is not a file-by-file redirect but more of a full folder redirect.
I tried to use a symlink that pointed latest → v1.0.0 folders but Hugo only displays the pages on the /docs/latest URL and gives a 404 if I try to access the /docs/v1.0.0/ URLs.

Thanks
Joao

It’s trivial to create an alias (meta refresh) for the list page, but this only applies to the list page, not the sub-pages.

content/docs/v1.0.0/_index.md

aliases = ['/docs/latest']

Redirection of an entire directory, recursively, should be handled on server side, so the solution will depend on how you are hosting the live site.

We are using netlify, so it should be a netlify redirect in our case.

Thanks

1 Like

In case you haven’t already found it: Bulk redirect as partial might be of interest to you.