Skip to content

Glossary: Next.js Beyond the Basics

redirect()

Also written: redirects(), 307, 308

redirect("/shop") from next/navigation sends the visitor elsewhere by throwing a special error, so call it last and never inside try/catch. Fixed moves belong in redirects() in next.config.ts, and permanent ones answer 308.

Where the book teaches it

Related terms

Status codeNextResponse