【问题标题】:Fallback to default TYPO3 page type if invalid type number/typeNum is requested如果请求了无效的类型号/typeNum,则回退到默认的 TYPO3 页面类型
【发布时间】:2019-11-18 18:05:25
【问题描述】:

在我的 TYPO3 9 LTS 安装中,当带有无效(即没有配置 TypoScript)类型号 (PAGE.typeNum) 的请求进来时,我的安装返回一个丑陋的错误消息:

请求示例:https://www.example.com?type=1234

示例响应:

Service Unavailable (503)
The page is not configured! [type=1234][]. This means that there is no TypoScript object of type PAGE with typeNum=1234 configured.
More information regarding this error might be available online.

更多信息链接指向https://typo3.org/go/exception/CMS/1294587217,但目前没有任何有用的信息如何更好地配置我的安装。

这些错误消息也很烦人,因为它们可能由网络爬虫触发,并且每个请求都会在 TYPO 系统协议中创建一个错误条目。

如果未配置请求的类型编号,我该怎么做才能回退到/提供默认的 type=0 HTML 页面?

【问题讨论】:

    标签: typo3 typoscript typo3-9.x


    【解决方案1】:

    AFAIK TYPO3 目前无法正确处理该问题。生成了503,但是没有触发站点配置中对应的errorHandler。

    当您处于 TYPO3_CONTEXT=Production ... 时,至少错误消息会不那么难看(“糟糕,错误...”)...

    有一个功能请求使未知页面类型的行为类似于 404:https://forge.typo3.org/issues/86844

    目前我建议为您不想在 TYPO3 之外提供服务的所有类型添加重定向 (301)(例如 .htaccess RewriteRules 或 nginx 重写)。

    【讨论】:

      猜你喜欢
      • 2020-08-21
      • 1970-01-01
      • 2017-08-09
      • 2014-02-04
      • 1970-01-01
      • 1970-01-01
      • 2022-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多