Repository navigation
docs(router): document catch-all routes for not found pages - #4797
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 of 2 tasks
brandyscarney
approved these changes
Oct 21, 2026
brandyscarney
left a comment
Member
There was a problem hiding this comment.
Looks good! I added a few optional suggestions.
Member
There was a problem hiding this comment.
It doesn't need to be done now but we should consider adding a Navigation/Routing guide under JavaScript like the other frameworks have:
- https://ionicframework.com/docs/angular/navigation
- https://ionicframework.com/docs/react/navigation
- https://ionicframework.com/docs/vue/navigation
I think that would be a better place for this kind of information.
ShaneK
added a commit
to ionic-team/ionic-framework
that referenced
this pull request
Oct 23, 2026
Issue number: resolves #24726 --------- ## What is the current behavior? Currently, `ion-router` can't match an unknown path, so there's no way to render a "not found" page. A `*` in an `ion-route` url is matched literally, `url="/:any"` only catches a single segment, and an unknown path below a known route (e.g., `/admin/settings`) renders that route. ## What is the new behavior? An `ion-route` url that ends in `*` now matches any remaining path, and the matched part is passed to the component as `pathMatch`. Ranking follows React Router, so a catch-all only beats a route that matches the whole path when it has more fixed segments (`/admin/*` beats `/:section/:id` but not `/admin/:id`). It always beats a route that only matches by ignoring trailing segments. Apps without a `*` route match exactly as before. ## Does this introduce a breaking change? - [ ] Yes - [X] No Not a breaking change, but a new feature, which is why it's in a feature branch. ## Other information This only affects vanilla JS and Stencil apps, since Angular, React and Vue use their own routers. The `*` in `ion-route-redirect` is unchanged, so `from="/admin/*"` still doesn't match `/admin` while `url="/admin/*"` does. The docs call out that difference (after [the docs PR](ionic-team/ionic-docs#4797) is merged). [Catch-all test page](https://ionic-framework-git-fw-6969-ionic1.vercel.app/src/components/router/test/catch-all?ionic:mode=ios#/docs/a/b) ## Latest dev build ``` 9.0.7-dev.11792524803.14f0e7d2 ```
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Ionic Framework 9.1 we're adding support for catch-all routes in ion-router, this docs change adds relevant verbiage to help users know about this functionality when it's released.