Repository: angular
Issue: UrlMatcher no longer receives the full url SegmentGroup after redirect
Labels: freq1: low,regression,area: router,P4

### Which @angular/* package(s) are the source of the bug?

router

### Is this a regression?

Yes

### Description

In angular 15, UrlMatcher functions used to receive the full SegmentGroup of the url after a redirect which allowed them process segments which had previously been consumed.  This was helpful for cases where, for instance, the matcher depended on a specific value of a parameter.

In angular 16, after a redirect, the UrlMatcher receives a SegmentGroup with no segments.

I believe this is because in angular 15 the router had a step called "applyRedirects" which would match against routes to determine if a redirect should occur, and after that "recognize" received a parameter with the full "urlAfterRedirects"

In this commit, this step was removed: [3c7e63737407287986c65136efd1f53d1215a53e](https://github.com/angular/angular/commit/3c7e63737407287986c65136efd1f53d1215a53e)

Which I think was part of the effort to address this: [issue](https://github.com/angular/angular/issues/26081)

That issue mentions "This is also a breaking change because it can result in new (but correct) routing behavior in applications" so I'm thinking it's possible that the v15 behavior was "incorrect" and the current behavior is now considered "correct."

However, my own opinion on this is that the new behavior for UrlMatchers really limits how they can be used, and in addition to that, makes their behavior inconsistent between redirect navigations and standard navigations.  For standard navigations, they still receive the full SegmentGroup while for redirect navigations they receive an empty one.

I did my best to come up with a minimal reproduction:
[v15](https://stackblitz.com/edit/stackblitz-starters-qfc2ig)
[v16](https://stackblitz.com/edit/stackblitz-starters-uem8kw)
[v18](https://stackblitz.com/edit/stackblitz-starters-ux4qvj)

### Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-ux4qvj

### Please provide the exception or error you saw

```true
In the v15 example I provided, the links "To Container With Match" and "To A With Match" work the same and match the child route with the UrlMatcher.  "To Container With Match" is a redirect navigation and "To A With Match" is a direct navigation.

In the v16 and v18 examples, "To Container With Match" is "broken" and does not match the child route with the UrlMatcher.
```


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 16.2.14
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 16.2.12
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1602.14
@angular-devkit/build-angular   16.2.14
@angular-devkit/core            16.2.14
@angular-devkit/schematics      16.2.14
@angular/cli                    16.2.14
@schematics/angular             16.2.14
rxjs                            7.8.1
typescript                      5.1.6
zone.js                         0.13.3


through


Angular CLI: 18.1.0
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 18.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1801.0
@angular-devkit/build-angular   18.1.0
@angular-devkit/core            18.1.0
@angular-devkit/schematics      18.1.0
@schematics/angular             18.1.0
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.7
```


### Anything else?

_No response_