6

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?

1
  • Is it a full stack app? Or just a front-end app? Commented Jul 31, 2016 at 20:38

1 Answer 1

4

I've had this issue before and found this article that helped me tremendously. You need to do some server side rewrites.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, I found what I needed to change and fixed it
would have been better if you added the specific part that you used to solve this problem

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.