Open sam-hsbu opened 11 months ago
I'm facing a similar issue, if I have the loading file, the redirect (not using permanent) doesn't happen immediately, it does a 200 first flickering the base layout, and then switch to the redirected page. If I remove the loading, it renders correctly all conditions.
Oh I'm not alone so :)
Is there anyone here ?
Please.
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote đ on the issue description or subscribe to the issue for updates. Thanks!
facing the same issue
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote đ on the issue description or subscribe to the issue for updates. Thanks!
Link to the code that reproduces this issue
https://github.com/sam-hsbu/redirectPermanent
To Reproduce
Now when we go to : http://localhost:3000/redirect, we are redirected to the homepage as expected, with a 308 status code :
Let's launch a curl.exe -X HEAD -I http://localhost:3000/redirect
We get this result as expected :
HTTP/1.1 308 Permanent Redirect Vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url, Accept-Encoding Location: / Cache-Control: no-store, must-revalidate X-Powered-By: Next.js Content-Type: text/html; charset=utf-8 Connection: keep-alive Keep-Alive: timeout=5
The redirection is still made but the status code is 200 :
HTTP/1.1 200 OK Vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url, Accept-Encoding Cache-Control: no-store, must-revalidate X-Powered-By: Next.js Content-Type: text/html; charset=utf-8 Connection: keep-alive Keep-Alive: timeout=5
Current vs. Expected behavior
I expected a 308 status code with or without the loading page.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
I tried with nextjs 14.0.1 , 14.0.4 and 14.0.5-canary.5.