TYPO3 - 新闻扩展 - 重复的网址

时间:2018-02-15 10:47:00

标签: typo3 typo3-6.2.x realurl

我正在使用:

  • Typo3 v6.2
  • 新闻扩展v3.2.6
  • RealURL v2.0

我开始了所有网站的优化项目,我目前正在处理有关网址的问题。我注意到我的所有新闻都有2个不同的网址:

如何解决此问题并将[...]/detail.html重定向到另一个问题? 这是我的真实配置:

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
  '_DEFAULT' => 
  array (
    'init' => 
    array (
      'appendMissingSlash' => 'ifNotFile,redirect',
      'postVarSet_failureMode' => '',
      'emptyUrlReturnValue' => '/',
      'emptySegmentValue' => 'default',
    ),
    'pagePath' => 
    array (
      'rootpage_id' => '1',
      'languageGetVar' => 'L',
      'expireDays' => 30
    ),
    'preVars' => 
    array (
      0 => 
      array (
        'GETvar' => 'L',
        'valueMap' => 
        array (
          'fr' => '2',
          'de' => '3',
        ),
        'noMatch' => 'bypass',
      ),
    ),
    'fileName' => 
    array (
      'defaultToHTMLsuffixOnPrev' => 0,
      'acceptHTMLsuffix' => 0,
      'index' => 
      array (
        'print.html' => 
        array (
          'keyValues' => 
          array (
            'type' => 98,
          ),
        ),
        'resultats.html' => 
        array (
          'keyValues' => 
          array (
            'tx_indexedsearch_pi2[controller]' => 'Search',
            'tx_indexedsearch_pi2[action]' => 'search',
          ),
        ),
      ),
    ),

    'postVarSets' => 
    array (
      '_DEFAULT' => 
      array (
        'article' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_news_pi1[news]',
            'lookUpTable' => 
            array (
              'table' => 'tx_news_domain_model_news',
              'id_field' => 'uid',
              'alias_field' => 'title',
              'useUniqueCache' => 1,
              'useUniqueCache_conf' => 
              array (
                'strtolower' => 1,
                'spaceCharacter' => '-',
              ),
            ),
          ),
        ),
        'category' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
            'lookUpTable' => 
            array (
              'table' => 'sys_category',
              'id_field' => 'uid',
              'alias_field' => 'title',
              'useUniqueCache' => 1,
              'useUniqueCache_conf' => 
              array (
                'strtolower' => 1,
                'spaceCharacter' => '-',
              ),
            ),
          ),
        ),
      ),
    ),
  ),
);
?>

谢谢!

1 个答案:

答案 0 :(得分:0)

尝试在realurl_conf.php文件中使用以下realURL配置。

'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,realurl_conf.php
                'useUniqueCache_conf' => array(
                  'strtolower' => 1,
                  'spaceCharacter' => '-'
                ),
                'languageGetVar' => 'L',
                'languageExceptionUids' => '',
                'languageField' => 'sys_language_uid',
                'transOrigPointerField' => 'l10n_parent',
                'expireDays' => 180,
            )
        )
    ),
    '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' => '-'
                )
            )
        )
    ),
    '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' => '-'
            )
          )
        )
    ),
  '41' => 'newsDetailConfiguration',   // News Details PageId
  '41' => 'newsDetailConfiguration',   // For additional detail pages, add their uid as well
  '2' => 'newsCategoryConfiguration',  // News Plugin PageId
  '2' => 'newsTagConfiguration',       // News Plugin PageId
),