I'm in the process of setting up a Typescript SPA project using Visual Studio and AngularJS for routing. Here is my current configuration...
var app = angular.module("myApp", ["ngRoute"]);
app.config(($routeProvider, $locationProvider) => {
$routeProvider
.when("/", {
templateUrl: "/pages/index/index.html"
})
.when("/about", {
templateUrl: "/pages/about/about.html"
})
.otherwise({ redirectTo: '/' });
$locationProvider.html5Mode(true);
});
Everything works smoothly so far, with the URLs appearing as desired. However, upon page refresh, I encounter either a 404 or 403 error depending on whether it's the main page or the about page. How can I ensure that refreshing the page directs me to the correct content?