Topic: Unexpected 301 Permanent Redirects for Prefix-Based Routes in Next.js 14.2.5 #73126
-
Description: In a Next.js 14.2.5 application, I encountered an issue where defining two similarly prefixed routes, Here’s a detailed explanation of the problem, my observations, and how I eventually resolved it by restructuring the routes. Steps to Reproduce
Observed Behavior
WorkaroundTo resolve the issue, I changed the route structure to use nested paths, as follows:
After making this change:
Expected Behavior
Feedback and Questions
Environment
Key Observations:
Would love to hear from others if they’ve faced similar issues and how they addressed them. Additionally, any insights or guidance from the Next.js maintainers on whether this is a known limitation or a bug would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I tried to reproduce your problem, and there is no problem in my case 🤷♂️ Probably you are using custom middleware or external packages which affecting your routing. |
Beta Was this translation helpful? Give feedback.
Hi @KamaniBhavin
I tried to reproduce your problem, and there is no problem in my case 🤷♂️
Probably you are using custom middleware or external packages which affecting your routing.