通常リダイレクト
pages/sample.tsxexport const getServerSideProps: GetServerSideProps = async (context) => {
return {
redirect: {
permanent: false,
destination: '/'
}
}
}
404エラーページへのリダイレクト
pages/sample.tsxexport const getServerSideProps: GetServerSideProps = async (context) => {
return {
notFound: true,
}
}