【发布时间】:2011-04-06 11:52:54
【问题描述】:
我安装了 Umbraco 4.5,它运行良好。但我无法开始工作的一件事是 404。当它访问一个不存在的页面时,它会显示默认的 IIS7 404 页面,而不是内置的 umbraco 404 页面。
所以我假设这是 iis 中的一个设置,我必须更改 - 但是哪个?
【问题讨论】:
标签: iis http-status-code-404 umbraco
我安装了 Umbraco 4.5,它运行良好。但我无法开始工作的一件事是 404。当它访问一个不存在的页面时,它会显示默认的 IIS7 404 页面,而不是内置的 umbraco 404 页面。
所以我假设这是 iis 中的一个设置,我必须更改 - 但是哪个?
【问题讨论】:
标签: iis http-status-code-404 umbraco
从http://our.umbraco.org/forum/using/ui-questions/8244-IIS7--404复制:
基本上,你需要添加
<location path="Site Description">
<system.webServer>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
</location>
到您的 applicationHost.config 文件,其中“站点描述”是您在 IIS7 中的站点名称。
applicationHost.config 文件位于:system32\inetsrv\config
编辑:
如 cmets 中所述,如果此答案,您应该将此部分添加到您的 web.config 中,这样会更好,您应该始终避免在您自己的应用程序之外更改可能影响其他应用程序的配置文件。
【讨论】:
在 config/umbraco.settings 中,您可以设置要为自定义 404 加载的 umbraco 页面
<errors>
<!-- the id of the page that should be shown if the page is not found -->
<!-- <errorPage culture="default">1</errorPage>-->
<!-- <errorPage culture="en-US">200</errorPage>-->
<error404>1296`</error404>`
</errors>
页面错误页面 ID 位于 <error404> 和 </error404> 标记之间。
【讨论】: