0
votes

I'm using :

  • Typo3 v6.2
  • News extension v3.2.6
  • RealURL v2.0

I began an optimization projet of the all website and i'm currently handling issues about URLs. I noticed that all my news has 2 distinct URL :

How to fix this issue and redirect [...]/detail.html to the another one ? Here my realurl configuration :

<?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' => '-',
              ),
            ),
          ),
        ),
      ),
    ),
  ),
);
?>

Thanks !

1
put your realurl configuration code here.Pravin Vavadiya
@PravinVavadiya It's done. I read the RealURL documentation on GitHub but i do not understand anything, too complicated for me, I should be too stupid to use it.Paolito75
Try to use below configuration code.Pravin Vavadiya
And what about the rest of thje configuration already set ? I'm not comfortable with copy/paste 73 lines of code i don't understand :)Paolito75
Copy whole configuration code and paste befor 'postVarSets' keywords and also changed the pageIDPravin Vavadiya

1 Answers

0
votes

Try to use below realURL configuration in your realurl_conf.php file.

'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
),