我们正在更新一个古老的TYPO3项目,我们已经在TYPO3 9.5上运行,经过大量的重构,它看起来很好。
现在我重做了ext:indexed_search部分,它被实现在T3Core中(sysext:indexed_search),所以如果我禁用我的站点配置,搜索就能正常工作。
base: 'ourDomain'
baseVariants:
-
base: 'ourDomain'
condition: 'applicationContext == "Development"'
-
base: 'ourDomain'
condition: 'applicationContext == "Testing"'
errorHandling: { }
languages:
-
title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ''
flag: at
languageId: '0'
rootPageId: 1
routes: { }
routeEnhancers:
搜索就不能正常工作了. 我可以导航到搜索页面,仍然有搜索表单之类的东西,但是没有结果显示. IM在SearchController里面转储$search,发现它实际上是空的.
经过研究,我认为可能是RouteEnhancer配置的问题,所以我在网站cfg中添加了一些配置。
routeEnhancers:
IndexedSearchPlugin:
type: Extbase
limitToPages:
- 41
extension: IndexedSearch
plugin: Pi2
routes:
- routePath: '/search'
_controller: 'Search::search'
defaultController: 'Search::search'
所以作为我们的根页面的子页面,我们有一个叫做 "Suche"(route=suche)的页面,里面有indexed_search插件。
所以RouteEnhancer应该像domain.atsuche -> hit search -> suchesearch results一样工作,对吗?
我不能让这个工作,因为相当长的时间,帮助是非常感激。
因为如果没有这个斜线,用户就会被重定向而丢失POST数据。
解决办法是
.htaccess:
#redirect urls without slash
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
网站配置:
routeEnhancers:
IndexedSearchPlugin:
type: Extbase
limitToPages:
- 41
extension: IndexedSearch
plugin: Pi2
routes:
- routePath: '/search'
_controller: 'Search::search'
defaultController: 'Search::search'
PageTypeSuffix:
type: PageType
default: '/'
index: ''
map:
'/': 0