Next.js 16 · Data and server code

Redirect

Send the user to another route from server code.

import { redirect } from "next/navigation";

redirect("/login");

Official Next.js 16 documentation

More data and server code commands

All data and server code commands · Next.js 16 cheatsheet

Was this page helpful?