我有一个EpiServer 7站点,我正尝试将一个自定义的404页面连接到该站点。
I解决方案在本地运行时运行良好。当我部署到临时服务器(站点未上线)时,需要2-3分钟来显示我的404页面。如果我登录到服务器,并运行相同的URL,我会立即显示自定义的404页面?
我在web.config中的条目是(内部):
<httpErrors errorMode="Custom" existingResponse="Replace">
<clear />
<error statusCode="404" responseMode="ExecuteURL" prefixLanguageFilePath="en" path="/system/pagenotfound/" />
</httpErrors>有什么想法吗?
发布于 2014-02-20 23:26:43
我也有同样的问题,你们有自定义的路由映射吗?像这样:
protected override void RegisterRoutes(RouteCollection routes)
{
routes.MapRoute("404", "404",
new { controller = "ContentPage", action = "NotFound" });
base.RegisterRoutes(routes);
}删除该路由并添加以下全部捕获路由:
protected override void RegisterRoutes(RouteCollection routes)
{
base.RegisterRoutes(routes);
routes.MapRoute("Error", "{*url}",
new { controller = "ContentPage", action = "NotFound" });
}发布于 2014-06-25 09:40:14
我遇到了同样的问题,并意识到这是因为episerver.config上的globalErrorHandling。你应该把它设置为"Off",我猜你的episerver.config现在是"RemoteOnly“。
希望这能有所帮助
https://stackoverflow.com/questions/18056830
复制相似问题