2017-03-08 63 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 –

相關問題