angular.module('app').config(appRte);
function appRte($routeProvider, $locationProvider, storiesURL) {
$routeProvider.
when('/', {
templateUrl: 'stories.html',
controller: 'StoryController as StoryCtrl',
resolve: {
storyDataPromiseObject: ['StoryData', function(StoryData) {
return StoryData.getStories(storiesURL);
}]
}
})
.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
}
当我转到我的域根http://website.com/时,它工作正常,但如果我转到http://website.com/anything,我会收到错误消息。我希望网站重定向到/取而代之。这可能吗?