I have SPA, when I'm using routing and want to refresh a page I get 404 because it Client side routing.
How do I handle this?
Here is my routing:
app.config(function ($routeProvider, $locationProvider) {
$routeProvider
// route for the home page
.when('/', {
templateUrl: 'index.html'
})
.when('/category/gifts/', {
templateUrl: 'tpl/categories/category-gifts.html',
controller: 'giftsCtrl'
})
.when('/category/gifts/:id', {
templateUrl: 'tpl/categories/category-gifts.html',
controller: 'giftsCtrl'
})
.otherwise({ redirectTo: '/' });
$locationProvider.html5Mode(true);
});
For example: http://www.localhost After I enter into http://www.localhost/category/gifts/ and do CTRL + R or hit F5, I get 404, how should I take care about it?