Skip to content Skip to sidebar Skip to footer

Angularjs Pretty-url Not Working On Page Refresh If Base Href Is Set To Other Than '/'

I am new to AngularJS. I am currently facing problem in writing pretty urls for my views.I have set $locationProvider.html5Mode(true); to remove # from the urls displayed in the ad

Solution 1:

Other than enabling html5Mode on, you also need to update your server-side to redirect all the request like /login or /home etc to a single entry-point, like an index.html.

Server side

Using this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html)

Search for "Server side" on this documentation page:

angular $location docs

Post a Comment for "Angularjs Pretty-url Not Working On Page Refresh If Base Href Is Set To Other Than '/'"