Next.js · Middle · Question 53 of 75

How does a rewrite differ from a redirect in next.config.ts?

Explanation

Rewrites act as a proxy, e.g. mapping /api/:path* to another backend or an old app during migration. The user never sees the destination URL.

Further reading

Problem with a question

Next.js · Middle · question 53

Test yourself

Take the Next.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz