0

my Angular Code for stateProvider

 .state('profile',{
    url: '/profile',
    templateUrl: 'Templates/profile.html',
    controller: 'profileCtrl'
})


 .state('profile.details',{
        url: '/:id',
        templateUrl: 'Templates/profile.details.html',
        controller: 'profileCtrl'
    })

when i write this in chrome bar http://localhost/site/profile/1

Apache Response is The requested URL /site/profile.html/1 was not found on this server.

but if i click on ui-sref link it's open well

1

1 Answer 1

1

Because you're using client side routing, it is responsability of whatever server side technology you're using (Node.js, Rails, Django, ASP.NET...) to have a * (catch all) route that would accept everything and just render the same thing (your HTML with the bundle.js) and let the client to decide what to render.

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

2 Comments

Also it's worth noting if the $locationProvider settings has hashPrefix enabled and html5Mode disabled, the url also requires the prefix in it to route to the correct state when first loading the url or refreshing the page via the browser.
thats my demo link link click on sign in and refresh the page, i changed my html5mode to false but it's didn't work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.