Anchor links include rewritten part of the url in Pages Router #77394
Labels
Internationalization (i18n)
Related to Internationalization with Next.js.
Middleware
Related to Next.js Middleware.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/thirsty-cartwright-t8dhtw
To Reproduce
en
./en/index.tsx
<Link href="#about">
Current vs. Expected behavior
Following the steps from the previous section, I would expect that the link in the page would be only
#about
, but the prefix added in the middleware is included in the output of the page, the navigation works fine, but this affects the SEO of the page. In App Router the prefix is not included.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6031 Available memory (MB): 49152 Available CPU cores: 16 Binaries: Node: 18.19.0 npm: 10.2.3 Yarn: 1.22.4 pnpm: 10.4.0 Relevant Packages: next: 15.3.0-canary.17 // Latest available version is detected (15.3.0-canary.17). eslint-config-next: 15.2.3 react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Middleware, Internationalization (i18n)
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed)
Additional context
No response
The text was updated successfully, but these errors were encountered: