Skip to content

resolveRedirectTo breaks urls with several parameters #33504

Description

@ipekakuan

Command

serve

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

19

Description

paths like '/:country/:lang/some/urls/' when redirected to 'data' are redirected to /en/:lang/some/urls/data

Minimal Reproduction

in function resolveRedirectTo(routePath, redirectTo){} (packages/angular/ssr/src/routes/ng-routes.ts)
the '/:country/:lang/some/urls/' is replaced with '/*/:lang/some/urls/'

we heve routes like this
export const routes: Routes = [
{
path: ':country/:lang',
pathMatch: 'prefix',
loadComponent: () => //load some component,
children: [
{
path: 'some',
loadComponent: () => //load some component,
children: [
{
path: 'url',
loadComponent: () =>//load some component,
children: [
{
path: '',
redirectTo: 'data',
pathMatch: 'full',
},
{
path: 'data',
loadComponent: () =>//load some component,

          }             
        ],
      } 
    ],
  },
],

},
];

Exception or Error


Your Environment

Angular CLI       : 21.2.17
Angular           : 21.2.17
Node.js           : 22.13.1
Package Manager   : npm 10.9.2
Operating System  : win32 x64

Anything else relevant?

looks like related to #33154
#33159

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions