当所有语言都配置了语言块作为基础时,TYPO3将关于基础/引导重定向到404 [英] TYPO3 redirects regarding base / leading to 404 when all languages are configured with language slug as base
本文介绍了当所有语言都配置了语言块作为基础时,TYPO3将关于基础/引导重定向到404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当所有语言都配置为基本语言/de/
、/en/
等时,如何在TYPO3 v9重定向模块中配置关于基本/
的重定向?
我的问题是source_path
LIKE/something
导致404重定向。
我与xdebug进行了核对。出现404是因为处理的$route
没有语言信息,该信息在config.yaml
On Keylanguages:
中设置,但由于定义的基数,此处不匹配。
为了更清楚地说明这一点,请举几个例子:
- 所有现有页面都是可访问的,如
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页的内容
推荐答案
在https://forge.typo3.org/issues/87455#note-7
中已经讨论了一段时间因此切换到具有功能开关的typo3 10,或者使用我从伪造问题中复制的解决方法:
return [ 'frontend' => [ 'typo3/cms-redirects/redirecthandler' => [ 'disabled' => true, ], 'hotfix-redirecthandler' => [ 'target' => TYPO3CMSRedirectsHttpMiddlewareRedirectHandler::class, 'before' => [ 'typo3/cms-frontend/base-redirect-resolver', ], ], ], ];
位于Configuration/RequestMiddlewares.php
的扩展
这篇关于当所有语言都配置了语言块作为基础时,TYPO3将关于基础/引导重定向到404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文