2017-03-08 64 views
0

我已经使用gulp来构建我的客户端angularJS应用程序。在我部署到IIS后,我得到一个问题。浏览菜单时,我的页面正常工作。但是,当我刷新页面(或)复制并粘贴的URL给我404错误。 HTTP错误404.0 - 未找到 任何人都可以帮助我,解决这个问题吗?HTTP错误404.0 - 未找到与IIS的AngularJS

回答

0

使用otherwise方法,这是默认的路由时没有其他人获得匹配


你有没有在你的路线配置部分配置otherwise选项?

像这样?

app.config(function($routeProvider) { 
    $routeProvider.otherwise({ 
      templateUrl : "main.htm", 
      controller : "mainController" 
     }); 
}); 

您可以将此链接

https://www.w3schools.com/angular/tryit.asp?filename=try_ng_routing_otherwise

我希望你可以通过这个下面的讨论解决您的问题下测试

Refreshing page gives "Page not found"

+0

我没有任何问题,导航通过菜单,这意味着我有一个路线。我也配置了其他路由。 – Velkumar

+0

@Velkumar你尝试过'$ locationProvider.html5Mode(false);'?在你的路线配置 –

+0

http://stackoverflow.com/questions/14168836/refreshing-page-gives-page-not-found –

相关问题