angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

How to match url without query params, prerender #3761

Closed xesai closed 4 years ago

xesai commented 5 years ago

How to make router match url exactly without query params? I means I have state with url '/news' so if I go to '/news?' or '/news/?' or '/news?any' or '/news/?any' it must does not work and must handled like wrong url. I use url router provider to handle wrong states:

$urlRouterProvider.otherwise(function ($injector) { $injector.get('$window').location = '/404.html'; });

Now it just redirect me to default state '/news' if I put '?' at the end. I use it with prerender and it think like this is new url and it do caching.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.