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: 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:60fd30b0-2cb3-2082-355e-08cbb439ddb3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F32:261342:1AFB90:25ACBA:6AFDD7C9 |
| html-safe-nonce | af3a99575ab2bb2555b2b9efaf1c5762d5372782794299206bde682716768ccd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjMyOjI2MTM0MjoxQUZCOTA6MjVBQ0JBOjZBRkREN0M5IiwidmlzaXRvcl9pZCI6IjYxNzU4NjM4OTMzOTUzNjM3ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8e3715220fea86d8fd36aed9ac63e2a31509fe5d87f36d617219b5b7819cbef3 |
| 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 | 9918bd4004419458bcd838065ac2a76b76ebd11705d73909fff5ab99e996fa23 |
| 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 | a231c174493a6a442c0b0544475c918b30128208 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width