score:2

next/router is a client-side router. when you reload a page or enter the address in a browser, the request is handled by the server, so you wouldn't see events like routechangestart.

you can implement client-side redirecting that would work with both client-side and server-side routing.

client-side redirect:

const router = userouter();

useeffect(() => {
  router.push('/redirectlocation');
}, [])

if you need to make redirect on a server side before it responds to a browser, you would have to implement a custom server.

custom server


Related Query

More Query from same tag