artch/angular-route-segment

Multiple otherwise

Closed this issue · 0 comments

I've been searching and haven't found any answer. Can i have multiple $routeProvider.otherwise()?

Example:

$routeSegmentProvider.when('/site1', 'site1')
        .when('/site1/page', 'site1.page');

$routeSegmentProvider.when('/site2', 'site2')
        .when('/site2/page', 'site2.page');

How can i define two 404 page? One for each 'site'? If i use the code bellow will redirect to the same page. I want something like: site1/404 and site2/404.

$routeProvider.otherwise({redirectTo: '/404'});