Title: SSR redirects a `redirectTo` that uses a route parameter to the literal `:id` instead of the parameter value · Issue #34410 · angular/angular-cli · GitHub
Open Graph Title: SSR redirects a `redirectTo` that uses a route parameter to the literal `:id` instead of the parameter value · Issue #34410 · angular/angular-cli
X Title: SSR redirects a `redirectTo` that uses a route parameter to the literal `:id` instead of the parameter value · Issue #34410 · angular/angular-cli
Description: Command serve, build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description With server rendering, a route whose redirectTo reuses ...
Open Graph Description: Command serve, build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description With server ren...
X Description: Command serve, build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description With server ren...
Opengraph URL: https://github.com/angular/angular-cli/issues/34410
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSR redirects a `redirectTo` that uses a route parameter to the literal `:id` instead of the parameter value","articleBody":"### Command\n\nserve, build\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nWith server rendering, a route whose `redirectTo` reuses one of its own route parameters is redirected to the literal parameter name. The Angular router substitutes the matched parameter on the client:\n\n```ts\nexport const routes: Routes = [\n { path: 'old/:id', redirectTo: 'new/:id' },\n { path: 'new/:id', component: Detail },\n];\n```\n\n- Client-side navigation to `/old/5` ends up at `/new/5`.\n- A server-rendered request for `/old/5` responds `302` with `Location: /new/:id`.\n\n`resolveRedirectTo` in `packages/angular/ssr/src/routes/ng-routes.ts` replaces parameters of the parent route with `*`, but leaves `:id` in the `redirectTo` string unchanged. `buildPathWithParams` in `packages/angular/ssr/src/utils/url.ts` then only fills `*` segments from the request path, so the `:id` placeholder is never replaced.\n\n### Minimal Reproduction\n\n```sh\nng new repro --ssr --defaults # outputMode: server\n```\n\nRoutes as above, `serverRoutes` with `{ path: '**', renderMode: RenderMode.Server }`, then:\n\n```sh\nng build && node dist/repro/server/server.mjs\ncurl -i http://localhost:4000/old/5\n```\n\n### Exception or Error\n\n```text\nHTTP/1.1 302 Found\nLocation: /new/:id\n\nExpected `Location: /new/5`.\n```\n\n### Your Environment\n\n```text\n_ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n \n\nAngular CLI : 22.0.5\nNode.js : 24.15.0\nPackage Manager : yarn 1.22.22\nOperating System : darwin arm64\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/MeAkib","@type":"Person","name":"MeAkib"},"datePublished":"2026-10-20T04:08:04Z","url":"https://github.com/angular/angular-cli/issues/34410"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fc9b0ac5-a265-dd44-5843-0bbabd881de5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84CC:10DACD:1603409:1D2C950:6B0132C7 |
| html-safe-nonce | 32c247a25ddb2709bf59445e360fbd667f868b52dd6aa4f24ebe012b53ee0d91 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NENDOjEwREFDRDoxNjAzNDA5OjFEMkM5NTA6NkIwMTMyQzciLCJ2aXNpdG9yX2lkIjoiMjIwMzg2OTI3NzUzNzI1MjAzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 35933ce87e1089c7303ddd89b0818df9a0b5865241ffdccd155a8d7a2c31af05 |
| hovercard-subject-tag | issue:5935753300 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34410/issue_layout |
| twitter:image | https://opengraph.githubassets.com/025cff1d518ee3a4bdac8121cb765c8d1e09dfcb230535068216fba3bfda2e7b/angular/angular-cli/issues/34410 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/025cff1d518ee3a4bdac8121cb765c8d1e09dfcb230535068216fba3bfda2e7b/angular/angular-cli/issues/34410 |
| og:image:alt | Command serve, build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description With server ren... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MeAkib |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width