Skip to content

How to use lifecycle-apis#actions #5186

Answered by slorber
ghost asked this question in Q&A
Jul 16, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

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).

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).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@slorber
Comment options

slorber Jul 16, 2021
Collaborator

@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant