When I have the code like this:
phonecatApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/phones', {templateUrl: 'partials/phone-list.html',controller: 'PhoneListCtrl'
}).
when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html',controller: 'PhoneDetailCtrl'
}).
otherwise({redirectTo: '/phones'
});
}]);
I'm able to get the phoneslist by going to url: http://localhost:8000/app/#/phones
However, for removing # from url. if I replace the above code by this:
phonecatApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.
when('/phones', {templateUrl: 'partials/phone-list.html', controller: 'PhoneListCtrl'}).
when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: 'PhoneDetailCtrl'}).
otherwise({redirectTo: '/phones'});
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
}]);
And I go to url:http://localhost:8000/app/phones/ I see the Index of /app/phones/instead of my normal webpage.
Any idea where I'm going wrong ?
htaccessfor example in apache or web.config in IIS