Umbraco:如何摆脱 "This page is intentionally left ugly"

Umbraco: How to get rid of "This page is intentionally left ugly"

帮我去掉默认的400页

我已经实现了 IContentFinder 并将其添加为 ContentLastChanceFinderResolver。就像这里解释的那样:https://our.umbraco.org/documentation/reference/routing/request-pipeline/icontentfinder

这完美无缺!!

%25c3

但对于某些 url,我仍然看到 "This page is intentionally left ugly" 系统 404 页面。

例如:http://example.com/test%25c3

在 umbraco.com 上只返回一个空白页:https://umbraco.com/test%25c3

如何获得此行为?

我也试过用配置方式设置404页面,但还是显示"This page is intentionally left ugly"页面。 在 /config/umbracoSettings.config:

<errors>
    <error404>1105</error404>
</errors>

XSS

我想删除 "This page is intentionally left ugly" 页面的原因是它允许跨站点脚本攻击,因为它会输出您在 url.

中键入的内容

这意味着如果您将脚本标记添加到 url,它将在 "left ugly" 页面上执行

url/test%25c3给个:

HTTP 错误 404.11 - 未找到 请求过滤模块配置为拒绝包含双转义序列的请求。

使用 IIS 错误处理。 在 web.config 放在 <system.webServer>

下面
<httpErrors errorMode="Custom">
    <error statusCode="404" subStatusCode="11" path="/error.html" responseMode="ExecuteURL" />
</httpErrors>

并创建一个 error.html 文件,可以是空白的,或者如果你喜欢的话可以添加一些文本。

还有很多错误。试试这个 url 例如 http://umbraco.com/* or http://umbraco.com/lpt1 有关错误页面和 .NET CMS 的更多信息,例如 Umbraco 或 Sitecore,您可以在此处阅读:Sitecore and the error page 它也在某些 Umbraco 情况下。