Next.js Discord

Discord Forum

Redirect to "same path" in Vercel Firewall redirect

Unanswered
IPJT posted this in #help-forum
Open in Discord
Is it possible to configure a Vercel Firewall redirect rule that will redirect the user to the same path but under a different domain. Thanks

1 Reply

Western paper wasp
hi, as far as I know, it is not possible. Vercel Firewall cannot perform redirects while preserving the path.
To do this, you need to use Edge Middleware / redirects in next.config.js (or do it at the proxy/DNS level), not Firewall.

Vercel Firewall: https://vercel.com/docs/security/firewall

Redirects в Next.js (next.config.js): https://nextjs.org/docs/app/api-reference/next-config-js/redirects

Middleware + NextResponse.redirect:
https://nextjs.org/docs/app/building-your-application/routing/middleware