HTTP redirect
A 3xx response telling the client that what it wants is at another address, given in the Location header.
In more detail
A permanent redirect (301 or 308) lets you rename a public address while old links keep working during a migration. The OAuth redirect to a client’s registered redirect URI is the same mechanism used for a security purpose.
Related terms
- Location header — The response header that gives an address: where a newly created resource lives, where a job can be watched, or where a redirect points.
- redirect URI — The address an authorization server sends the browser back to, with the result, after the user signs in and consents.
- HTTP status code — The three-digit number at the start of a response, such as 200 or 404, that says how the server handled the request.
- NextResponse — Next.js' extension of the Web Response object, with helpers for JSON responses, cookies, redirects and rewrites.
- rewrite — Serving the content of a different path while the browser's address bar keeps the original URL.
Taught in
- Naming Resources And Collections — Modern API Architecture: REST, GraphQL & gRPC
- OAuth Two And OpenID Connect — Modern API Architecture: REST, GraphQL & gRPC
- Not Found Handling: not-found.tsx & Programmatic Exits — Next.js 15 & Modern App Router Architecture
- Edge Middleware: Auth Verification & Route Matchers — Next.js 15 & Modern App Router Architecture