I am building an angular site and using UI-Router, if I click a link to go to a route it works fine but whenever I refresh the page, or if I type the url in manually I get 'Cannot GET /find-a-vendor. I have this in my routes file:
$stateProvider
.state('home', {
url: '/',
templateUrl: 'views/home.html'
})
.state('find', {
url: '/find-a-vendor',
templateUrl: 'views/find.html'
})
I also have $locationProvider.html5Mode(true);
in my routes file as well. and in my index I have <base href="/">
in the header, is there something I'm missing?
I've had this issue before and found this article that helped me tremendously. You need to do some server side rewrites.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With