I was working on server-side redirection in react.
Inside getInitalProps i had done something like this
const { res } = ctx
if(some condtion === true){
redirection
res.writeHead(301, {
Location: 'new/url/destination/here'
});
res.end();
}
It worked but the thing is I'm not able to go to this page again even though the condition is false.
I removed the entire block but was still not able to go to this page. Tried restarting the server but no use. Help needed
i followed solution as per this but used 301 instead of 302 Conditional redirection in Next.js
Thanks in advance.