Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[Next-9.5.4] Rewrites URLs are not masked properly and instead interpolated. #17810
Comments
|
This doesn't seem to be expected The above rewrite should be something like this instead:
If you're using unconventional routing like this |


Bug report
Describe the bug
Hi, I have a rewrite in my app for rewriting a slug based url to legacy id based urls like:
Before Next 9.5.3, I was using router.push like this to navigate to slug based URL:
It works fine on 9.5.3 as well.
But, after moving to 9.5.4, the above rewrite gets interpolated and the URL on browser is displayed like:
/page/123/456?slug=some-bloginstead of/blog/some-blog.Is there another way to navigate to
/blog/some-blog? Or is it an issue with the interpolate?Regression PR: #16774
Line which causes this: https://github.com/vercel/next.js/pull/16774/files#diff-5eff10c96fa6858c659318492c4cf7f7R637
To Reproduce
I have created two codesandbox, one with 9.5.2 and one with 9.5.4 to show the behavior:
Next 9.5.4
/page/123/456?slug=some-blogExpected behavior
/blog/some-blogSystem information