This is a Next.js project bootstrapped with create-next-app created to reproduce redirect error to external URL with same host from a server action.
It is expected that the redirect will take the user to the expected absolute URL that is provided, but it redirects and appends the basePath to the pathname which makes it seem like it is treating URL as an internal redirect.
- Run on port 3000
- Navigate to
http://localhost:3000/redirect/external - Wait 10 seconds for
useEffectto run and redirect
Expected
Redirected to 404 error page with URL http://localhost:3000/external-page-with-same-host.
Actual
Redirected to 404 error page with URL http://localhost:3000/redirect/external-page-with-same-host.
Notes
- This will only occur the first time the page is loaded, after that the redirect works as expected

