Open Closed

angularjs and html5 url 404 error #555

max created

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?



2 Answer(s)
  • 0
    marcosli created

    If you are using IIS you need to install URL Rewrite and make some modifications on the web.config.

    I followed this []) but is still not working.

    If you find a solution, could you post it here?


  • 0
    thechrismarsh created

    Make sure you inject the location provider to the config ...

        '$stateProvider', '$urlRouterProvider', '$locationProvider',
        function ($stateProvider, $urlRouterProvider, $locationProvider) {

    Also make sure you add this to the head of the layout.cshtml view ...

    	<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>