Skip to content

blakel6819/nextjs-server-action-external-redirect

Repository files navigation

Overview

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.

Steps to Reproduce

  1. Run on port 3000
  2. Navigate to http://localhost:3000/redirect/external
  3. Wait 10 seconds for useEffect to 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

Screenshots

Screenshot-01 Screenshot-01

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors