简体   繁体   English

TYPO3-indexed_search在结果中生成错误的URL

[英]TYPO3 - indexed_search generates wrong URL's in result

I am using indexed_search for the frontend, so users can search on my page, eg search for news. 我在前端使用indexed_search,因此用户可以在我的页面上进行搜索,例如搜索新闻。

But the URLs in the result of the search is wrong! 但是搜索结果中的URL是错误的!

Eg 例如

Expected URL: 预期网址:

http://my-page.com/de/neuigkeiten/produktneuheiten/detail/neue-nachricht.html

Result URL: 结果网址:

http://my-page.com/de/neuigkeiten/produktneuheiten/detail/detail/News/neue-nachricht.html

You can see from the Result URL that /detail/News is rendered into the URL. 您可以从结果URL中看到/detail/News已呈现到URL中。

在此处输入图片说明

The structure of the pages looks like this: 页面的结构如下所示:

在此处输入图片说明

Questions: 问题:

  • Why does /detail/News appear in the URL? 为什么/detail/News出现在URL中?
  • How can I fix it? 我该如何解决?

Please let me know if you need any informations from me. 如果您需要我的任何信息,请告诉我。


typo3conf/realurl_conf.php typo3conf / realurl_conf.php

<?php

$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment';

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
    '_DEFAULT' => array (
        'init' => array (
            'enableCHashCache' => '1',
            'appendMissingSlash' => 'ifNotFile,redirect',
            'enableUrlDecodeCache' => '1',
            'enableUrlEncodeCache' => '1',
            'emptyUrlReturnValue' => '/',
            'postVarSet_failureMode' => ''
            //'postVarSet_failureMode' => 'redirect_goodUpperDir'
        ),
        'redirects' => array(
            'de.html'=>'de/',
            'en.html'=>'en/',
            'fr.html'=>'fr/',
            'es.html'=>'es/',
        ),
        'preVars' => array (
            array (
                'GETvar' => 'no_cache',
                'valueMap' => array (
                    'nc' => '1',
                ),
                'noMatch' => 'bypass'
            ),
            array(
                'GETvar' => 'L',
                'valueMap' => array(
                    'de' => '0',
                    'en' => '1',
                    'fr' => '2',
                    'es' => '3',
                ),
                'valueDefault' => 'de',
            ),
            array (
                'GETvar' => 'lang',
                'valueMap' => array (
                    'de' => 'de',
                    'en' => 'en',
                    'fr' => 'fr',
                ),
                'noMatch' => 'bypass',
            ),
        ),
        'pagePath' => array (
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => '7',
            'firstHitPathCache' => 1,
            'rootpage_id' => '1',
        ),
        'fixedPostVars' => array (
            'newsDetailConfiguration' => array(
                array(
                    'GETvar' => 'tx_news_pi1[action]',
                    'valueMap' => array(
                        'detail' => '',
                    ),
                    'noMatch' => 'bypass'
                ),
                array(
                    'GETvar' => 'tx_news_pi1[controller]',
                    'valueMap' => array(
                        'News' => '',
                    ),
                    'noMatch' => 'bypass'
                ),
                array(
                    'GETvar' => 'tx_news_pi1[news]',
                    'lookUpTable' => array(
                        'table' => 'tx_news_domain_model_news',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-'
                        ),
                        'languageGetVar' => 'L',
                        'languageExceptionUids' => '',
                        'languageField' => 'sys_language_uid',
                        'transOrigPointerField' => 'l10n_parent',
                        'autoUpdate' => 1,
                        'expireDays' => 180,
                    )
                )
            ),
            'newsCategoryConfiguration' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
                    'lookUpTable' => array(
                        'table' => 'sys_category',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-'
                        )
                    )
                )
            ),
            'newsTagConfiguration' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                    'lookUpTable' => array(
                        'table' => 'tx_news_domain_model_tag',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-'
                        )
                    )
                )
            ),
            '154' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
            '155' => 'newsDetailConfiguration',
            '156' => 'newsDetailConfiguration',
            '157' => 'newsDetailConfiguration',
            '399' => 'newsDetailConfiguration',
            '71' => 'newsTagConfiguration',
            '72' => 'newsCategoryConfiguration',
        ),
        'postVarSets' => array (
            '_DEFAULT' => array(
                'productfinder' => array(
                    array(
                        'GETvar' => 'tx_mbclpdb_mbclproductfinder[controller]',
                        'noMatch' => 'bypass'
                    )
                ),
                'filelist' => array(
                    array(
                        'GETvar' => 'tx_mbdownloads_mbfilelist[controller]',
                        'GETvar' => 'tx_mbdownloads_mbfilelistmarginal[controller]',

                    ),
                    array(
                        'GETvar' => 'tx_mbdownloads_mbfilelist[action]',
                        'GETvar' => 'tx_mbdownloads_mbfilelistmarginal[action]',
                        'noMatch' => 'bypass'
                    ),

                ),
                'controller' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[action]',
                        'noMatch' => 'bypass'
                    ),
                    array(
                        'GETvar' => 'tx_news_pi1[controller]',
                        'noMatch' => 'bypass'
                    )
                ),
                'dateFilter' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                    ),
                    array(
                        'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                    ),
                ),
                'page' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
                    ),
                ),
            ),
        ),
        'fileName' => array (
//
// if you don't want .html-URLs set the following to "false" (e.g. 'defaultToHTMLsuffixOnPrev' => false,)
// then you get http://www.yourdomain.com/imprint/ instead of http://www.yourdomain.com/imprint.html
//
            'defaultToHTMLsuffixOnPrev' => true,
            'index' => array (
                'sitemap.xml' => array (
                    'keyValues' => array(
                        'type' => 776,
                    )
                ),
                'rss.xml' => array (
                    'keyValues' => array (
                        'type' => '100',
                    ),
                ),
                'rss091.xml' => array (
                    'keyValues' => array (
                        'type' => '101',
                    ),
                ),
                'rdf.xml' => array (
                    'keyValues' => array (
                        'type' => '102',
                    ),
                ),
                'atom.xml' => array (
                    'keyValues' => array (
                        'type' => '103',
                    ),
                ),
                'news.rss' => array (
                    'keyValues' => array (
                        'type' => '9818',
                    ),
                ),
                'products.rss' => array (
                    'keyValues' => array (
                        'type' => '9819',
                    ),
                ),
                'events.rss' => array (
                    'keyValues' => array (
                        'type' => '9820',
                    ),
                ),
                'workshops.rss' => array (
                    'keyValues' => array (
                        'type' => '9821',
                    ),
                ),
                'news.json' => array (
                    'keyValues' => array (
                        'type' => '9898',
                    ),
                ),
            ),
        ),
    ),
);
?>

I was able to solve it by deleting these two arrays from the file typo3conf/realurl_conf.php : 我可以通过从文件typo3conf/realurl_conf.php删除这两个数组来解决此typo3conf/realurl_conf.php

            array(
                'GETvar' => 'tx_news_pi1[action]',
                'valueMap' => array(
                    'detail' => '',
                ),
                'noMatch' => 'bypass'
            ),
            array(
                'GETvar' => 'tx_news_pi1[controller]',
                'valueMap' => array(
                    'News' => '',
                ),
                'noMatch' => 'bypass'
            ),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM