Always redirect from page A to page B #13662
Answered
by
jamesmosier
sanderkooger
asked this question in
Help
-
All, I' m a new developer trying to hack together a Media on demand app. In this app i have the following page structure:
I want to sort my library pages in a subdirectory, but i want the /library url to always show the catwalks page. How do i make this happen? |
Beta Was this translation helpful? Give feedback.
Answered by
jamesmosier
Jun 2, 2020
Replies: 2 comments
-
One way to do it within Next would be to add this to your export async function getServerSideProps(context) {
context.res.writeHead(302, {
Location: '/library/catwalks',
});
context.res.end();
return {
props: {},
};
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jamesmosier
-
Opened a RFC here: #14890 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One way to do it within Next would be to add this to your
pages/library.js
(or more likelypages/library/index.js
):