-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add universal redirect example #1237
Add universal redirect example #1237
Conversation
Would be nice to have a deployment on now to see how it behaves 😊 |
@sedubois great idea, done 🙌 |
@@ -0,0 +1,19 @@ | |||
import React from 'react' | |||
import ErrorComponent from 'next/error' | |||
import redirect from 'next-universal-redirect' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we make this open? I can't see the source.
See: https://github.com/timneutkens/next-redirect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/timneutkens/next-universal-redirect seems like the package.json should be updated. Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 🙌
I think |
@sergiodxa it serves a different purpose. This one is for lists of redirects from non-existent pages to existent (well, if you screw up non-existent) pages. Next-redirect is for a more for redirecting when stuff happens. Also, next-redirect is not universal but only server side. |
actually it works on both: https://github.com/matthewmueller/next-redirect/blob/master/index.js#L16 |
@matthewmueller ah, right, I meant it doesn't use |
No description provided.