-
Hi again One question that came up (when migrating from Jekyll to Docusaurus) is how to keep ancient URLs a a little bit backward compatible (like the most important 10).
I try to use https://docusaurus.io/docs/lifecycle-apis#actions but to me it s a bit unclear where to hook into the lifecycle. I want to teach Docusaurus that at It would be sufficient for me if I can tell 🦖 to add like 10 routes which map an old We tried already to just use
Any help on that matter would be appreciated 👍🏼 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You want a redirect.
We have a client-side redirect plugin: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects This is basically a shortcut and exactly the same as adding manually a small So TLDR:
|
Beta Was this translation helpful? Give feedback.
You want a redirect.
Remember server-side redirects are always better than client-side redirects.
And they must be configured on your hosting provider. (if you use GitHub pages it's not possible, but it is on other hosts that I recommend such as Vercel/Netlify)
actions
allows you to create a React page.On this page you could do a client-side redirect (with js / React-Router's Redirect component) but it's not a good idea because that redirect would be slow (it would have to load React, hydrate it even before doing the redirect).
…