rewrite

Serving the content of a different path while the browser's address bar keeps the original URL.

In more detail

Unlike a redirect, the browser never sees the change. Rewrites are used for A/B tests, localisation, proxying to other services and multi-tenant apps.

Example

Next.js middleware rewrites with NextResponse.rewrite(); next.config can also define rewrites.

Related terms

Taught in

References