设置的errorPage的一把umbraco [英] Setting errorPage in Umbraco

查看:187
本文介绍了设置的errorPage的一把umbraco的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用一把umbraco一个Web应用程序。我创建了一个名为PageNotFound和内容umbracoSettings.config文件的错误部分,我把该节点ID为404 error404。问题是,与IIS 7,IIS一直在寻找在web.config中HttpErrors部分,不注重umbracoSettings.config。

I am developing a web application using Umbraco. I create a content called PageNotFound and the errors section of umbracoSettings.config file, I put the node id of that for 404 error404. The problem is that, with IIS 7, IIS always looking for HttpErrors section in web.config and does not pay attention to umbracoSettings.config.

为什么我应该怎么办?

推荐答案

在你的web.config(system.webServer节),你可以告诉网站通过所有的错误处理,通过对应用程序的:

In your web.config (system.webServer section) you can tell the site to pass all of the error handling through to the application:

<httpErrors existingResponse="PassThrough" />

这都有一把umbraco不处理任何事情,但没有被发现的.aspx页面的缺点。

This has the disadvantage that Umbraco doesn't handle anything but .aspx pages that are not found.

您可以使它更好地做这样的事情,而不是:

You could make it better by doing something like this instead:

<httpErrors errorMode="Custom">
       <remove statusCode="404" subStatusCode="-1" />
       <error statusCode="404" prefixLanguageFilePath="" path="/non-existing-page.aspx" responseMode="ExecuteURL" />
</httpErrors>

不存在的,page.aspx尚不存在于一把umbraco,所以触发404(因为它在aspx扩展名),.. preSTO:一把umbraco处理404完美

The non-existing-page.aspx does not exist yet in Umbraco, so it triggers a 404 (because it has the aspx extension) and.. presto: Umbraco handles the 404 perfectly!

这篇关于设置的errorPage的一把umbraco的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆