【发布时间】:2015-05-28 12:16:56
【问题描述】:
如果是 stateProvider,我需要将 http 响应代码从 200 更改为 404
.state('app.notfound', {
url: "not_found",
cache: false,
views: {
'menuContent' :{
templateUrl: "/template/not_found.html",
controller: "NotFoundCtrl"
}
}
});
$urlRouterProvider.otherwise('/not_found');
通常未找到控制器返回 200。如何更改响应代码? 谢谢
【问题讨论】:
-
为什么返回码在这里很重要?
-
通常你使用 .otherwise() 来重定向人们,因为他们被路由到了他们不应该去的地方。我无法想象你想要一个 404.. 制作一个看起来像 404 的 HTML 页面,也许吧?
标签: ajax angularjs apache http-headers ionic