Redirect on the server
On Next.js, the middleware from the Next.js guide does this for you. On Hydrogen and other servers, add it to your root loader or your middleware:Server (loader or middleware)
getRedirectUrl returns null when the visitor stays: they are in Control or outside the test, the URL is not part of a test, or the visitor is a known crawler. Redirecting on the server means the visitor never sees the original page first.