I am using angularjs ngRoute to routing a single page application. It shows the localhost/about or localhost/blog. When I reaload,"Cannot GET /about". How can I fix this.
my router configuration is below.
var myApp = angular.module('myApp',['ngRoute']);
myApp.config(['$locationProvider','$routeProvider',function($locationProvider,$routeProvider){
$locationProvider.html5Mode(true);
$routeProvider
.when('/',{
templateUrl: 'views/pages/home.html',
controller: 'homeCtrl'
})
.when('/about',{
templateUrl: 'views/pages/about.html',
controller: 'aboutCtrl'
})
.when('/contact',{
templateUrl: 'views/pages/contact.html',
controller: 'contactCtrl'
})
.when('/blog',{
templateUrl: 'views/pages/blog.html',
controller: 'blogCtrl'
})
.otherwise({redirectTo: '/home'});
}]);
I am using only angular.