【问题标题】:404 page in Umbraco?Umbraco 中的 404 页面?
【发布时间】:2011-04-06 11:52:54
【问题描述】:

我安装了 Umbraco 4.5,它运行良好。但我无法开始工作的一件事是 404。当它访问一个不存在的页面时,它会显示默认的 IIS7 404 页面,而不是内置的 umbraco 404 页面。

所以我假设这是 iis 中的一个设置,我必须更改 - 但是哪个?

【问题讨论】:

    标签: iis http-status-code-404 umbraco


    【解决方案1】:

    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 中,这样会更好,您应该始终避免在您自己的应用程序之外更改可能影响其他应用程序的配置文件。

    【讨论】:

    • 在 web.config 中添加 对我有用
    • 我对这个答案投了赞成票,但是按照安德里亚斯的建议去做对我有用。只需将 添加到站点根目录上的 Umbraco 的 web.config 中即可。
    • 如你所说,将其添加到 web.config 也可以(当然,我没有想到这一点),这是一个更好的解决方案。
    【解决方案2】:

    在 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 位于 &lt;error404&gt;&lt;/error404&gt; 标记之间。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多