In Next JS 12 if you want to redirect you used to return an object from getServerSideProps that holds the distination path and if it is a permanent redirect or not
return {
redirect: {
destination: "/",
permanent : true
},
};
now in Next js 13 we should use redirect() in server components but this redirect() function does not accept any parameters other than the destination https://nextjs.org/docs/app/api-reference/functions/redirect