Next.js Discord

Discord Forum

Link to rewrited pages don't works (Pages router)

Unanswered
Mattèo posted this in #help-forum
Open in Discord
Hey I'm trying to create a Link to a specific page that is rewrited, but the URL is changed to the original URL. Here is my routes, to better explain.

➡️ src/pages/_courses/[id]/lesson-player.tsx is rewrited to <id>.rootDomainName.com/lesson-player through middlewares (like explained in vercel/platforms or dub.sh)

Then on my pages I use the next/link components to navigate.

From the page <id>.rootDomainName.com/course-overview I have a<Link href={"/lesson-player"}/> component, on click it navigates to https://<id>.rootDomainName.com/_courses/<id>/lesson-player

How to navigate my users to <id>.rootDomainName.com/lesson-player with Link component

0 Replies