I have a project using nextjs v12
I have 2 routes that are overlapping in a weird way.
/:academy/:course
/questions/:id
when I load /questions/1
it works as expected
when I load /mit/math
it works as expected
The issue:
when I redirect from /questions/1
to /questions/2
,
it loads, you guessed it, the other route! (/:academy/:course
)
and more, when I refresh the page (after the redirect) it will load the /questions/:id
!!!
I tried
- check for miss spelling
- make
/questions/:id
->/aquestions/:id
so, do you know a way to solve this issue?
thanks.
Solved
it was /q/:id
and I renamed it to /q/:id
.
and because it's with ssr (I think), I had to clear the cache and restart the project.