You can create a "catchall" route rule like this: :ids*
This tells the router to store everything after /:extension/ into the ids route-parameter. Your $routeProvider
can look something like this:
$routeProvider
.when( '/:extension/:ids*', {
templateUrl: 'this.html',
controller: 'routeCtrl'
})
.when( '/that', { templateUrl: 'that.html' } )
.otherwise( { redirectTo: '/that' } );
The /:extension/:ids*
will then catch both "/Something/1" and "/Someotherthing/1/2/3". The ids route-parameter will in the last case have the value "1/2/3". You can split up this into an array if you want, like this in your controller:
$scope.ids = $routeParams.ids.split("/");
I have created a plunker here if you want to take a closer look: http://plnkr.co/edit/EZqMtnbRs0lKc07hnenQ?p=preview
Update: You can also specify optional route-parameters like this, if you don't want to store everything into a single id-variable:
$route$routeProvider
.when( '/:extension/:id/:id2?/:id3?', {
templateUrl: 'this.html',
controller: 'routeCtrl'
})
The ?
at the end signals that the parameter is optional.