【问题标题】:TYPO3 redirects regarding base / leading to 404 when all languages are configured with language slug as base当所有语言都配置为语言 slug 作为基础时,TYPO3 重定向关于基础 / 导致 404
【发布时间】:2020-05-01 22:47:41
【问题描述】:

当所有语言都使用语言 slug 作为基础 /de//en/ 等配置时,如何在 TYPO3 v9 重定向模块中配置关于基础 / 的重定向?

我的问题是 source_path 的重定向,例如 /something 会导致 404。

我检查了 xdebug。发生 404 是因为处理后的 $route 没有语言信息,该信息在 config.yaml 上的键 languages: 中设置,但由于定义的基数,此处不匹配。

为了更清楚一些例子:

  • 所有现有页面都可以访问,例如http://typo3.demo.local:3000/de/example1/ http://typo3.demo.local:3000/en/example1/ 等等
  • 普通的基本 url http://typo3.demo.local:3000/ 默认行为重定向到默认语言 http://typo3.demo.local:3000/de/
  • 在 TYPO3 v9 重定向模块中,应遵循从 http://typo3.demo.local:3000/test1/http://typo3.demo.local:3000/de/example1/ 的重定向 但没有重定向,它会在 http://typo3.demo.local:3000/test1/ 上显示来自 404 页面的内容

【问题讨论】:

    标签: typo3 typo3-9.x


    【解决方案1】:

    这已经在https://forge.typo3.org/issues/87455#note-7讨论了一段时间

    所以切换到具有功能开关的typo3 10 或使用我从伪造问题复制的这样的解决方法:

    return [ 'frontend' => [ 'typo3/cms-redirects/redirecthandler' => [ 'disabled' => true, ], 'hotfix-redirecthandler' => [ 'target' => \TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler::class, 'before' => [ 'typo3/cms-frontend/base-redirect-resolver', ], ], ], ];
    

    Configuration/RequestMiddlewares.php的扩展中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-28
      • 2018-01-09
      • 2018-09-22
      • 2021-04-10
      • 1970-01-01
      • 2017-03-26
      • 2013-06-09
      相关资源
      最近更新 更多