How can I make <Link> work with the new rewrites feature? #16014
-
Hi, I'm trying to use the new rewrites feature but I'm stuck on making Here's my config:
I have a page at I tried these two ways to create a link to
The first one throws this error:
while the second one causes a full page reload. Is there any way to make this link work like how normal links work (no full page reload)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, you can make this work by using mis-matching <Link href="/news/[slug]" as="/news/hello">
<a>/blog/hello</a>
</Link>
<Link href="/news/[slug]?slug=hello" as="/blog/hello">
<a>/blog/hello</a>
</Link> |
Beta Was this translation helpful? Give feedback.
Hi, you can make this work by using mis-matching
href
andas
values and manually providing the dynamic route params. We're aiming to streamline this so this is no longer needed, but the below example should allow you to achieve this on the latest version of Next.js