hi, I am using angularjs and ui.router and I activated " $locationProvider.html5Mode (true ) ; " but I have a problem when I do refersh page : the browse show 404 error .. any solution?
br
Max
2 Answer(s)
-
0
If you are using IIS you need to install URL Rewrite and make some modifications on the web.config.
I followed this [http://www.advancesharp.com/blog/1191/angularjs-html5-mode-reloading-page-not-found-solution]) but is still not working.
If you find a solution, could you post it here?
Thanks!
-
0
Make sure you inject the location provider to the config ...
appModule.config([ '$stateProvider', '$urlRouterProvider', '$locationProvider', function ($stateProvider, $urlRouterProvider, $locationProvider) { $locationProvider.html5Mode(true);
Also make sure you add this to the head of the layout.cshtml view ...
<head> <base href="/">
following these two steps alone worked for me ... <ins><span style="color:#0040FF">/Application#/host/tenants</span></ins> turns into <ins><span style="color:#0040FF">/host/tenants</span></ins>