0

I'm doing the exact steps of the following answer: https://stackoverflow.com/a/16731438

However, if I switch to Manual Configuration I got the following error, even if my realurl_conf.php is the exact same file as realurl_autoconf.php was before:

Page Not Found

Reason: Segment "fotografie" was not a keyword for a postVarSet as expected on page with id=0.

If I switch back to automatic config everything works as expected.

Any ideas on that?

TYPO3 7.6.11

Here is the realurl_autoconf.php:

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
  'brightfocus.de' => 
  array (
    'init' => 
    array (
      'appendMissingSlash' => 'ifNotFile,redirect',
      'emptyUrlReturnValue' => '/',
    ),
    'pagePath' => 
    array (
      'rootpage_id' => '1',
    ),
    'fileName' => 
    array (
      'defaultToHTMLsuffixOnPrev' => 0,
      'acceptHTMLsuffix' => 1,
      'index' => 
      array (
        'print' => 
        array (
          'keyValues' => 
          array (
            'type' => 98,
          ),
        ),
      ),
    ),
    'postVarSets' => 
    array (
      '_DEFAULT' => 
      array (
        't3extblog-action' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[action]',
            'noMatch' => 'bypass',
          ),
        ),
        'article' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[year]',
          ),
          1 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[month]',
          ),
          2 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[day]',
          ),
          3 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[post]',
            'lookUpTable' => 
            array (
              'table' => 'tx_t3blog_post',
              'id_field' => 'uid',
              'alias_field' => 'title',
              'addWhereClause' => ' AND NOT deleted AND NOT hidden',
              'useUniqueCache' => 1,
              'useUniqueCache_conf' => 
              array (
                'strtolower' => 1,
                'spaceCharacter' => '-',
              ),
              'enable404forInvalidAlias' => 1,
              'autoUpdate' => 1,
              'expireDays' => 180,
              'languageGetVar' => 'L',
              'languageExceptionUids' => '',
              'languageField' => 'sys_language_uid',
              'transOrigPointerField' => 'l18n_parent',
            ),
          ),
        ),
        'comment' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[controller]',
            'noMatch' => 'bypass',
            'valueMap' => 
            array (
              'new' => 'Comment',
            ),
          ),
        ),
        'permalink' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[permalinkPost]',
          ),
        ),
        'preview' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[previewPost]',
          ),
        ),
        'author' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[author]',
            'lookUpTable' => 
            array (
              'table' => 'be_users',
              'id_field' => 'uid',
              'alias_field' => 'username',
              'addWhereClause' => ' AND deleted !=1 AND disable !=1',
              'useUniqueCache' => 1,
              'useUniqueCache_conf' => 
              array (
                'strtolower' => 1,
                'spaceCharacter' => '-',
              ),
              'enable404forInvalidAlias' => 1,
              'autoUpdate' => 1,
              'expireDays' => 180,
            ),
          ),
        ),
        'tags' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[tag]',
          ),
        ),
        'category' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[category]',
            'lookUpTable' => 
            array (
              'table' => 'tx_t3blog_cat',
              'id_field' => 'uid',
              'alias_field' => 'catname',
              'addWhereClause' => ' AND deleted !=1 AND hidden !=1',
              'useUniqueCache' => 1,
              'useUniqueCache_conf' => 
              array (
                'strtolower' => 1,
                'spaceCharacter' => '-',
              ),
              'enable404forInvalidAlias' => 1,
              'autoUpdate' => 1,
              'expireDays' => 180,
              'languageGetVar' => 'L',
              'languageExceptionUids' => '',
              'languageField' => 'sys_language_uid',
              'transOrigPointerField' => 'l18n_parent',
            ),
          ),
        ),
        'page' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsystem[@widget_0][currentPage]',
          ),
        ),
        'subscription' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_subscriptionmanager[controller]',
            'valueMap' => 
            array (
              'blog' => 'BlogSubscriber',
              'post' => 'PostSubscriber',
            ),
            'noMatch' => 'bypass',
          ),
          1 => 
          array (
            'GETvar' => 'tx_t3extblog_subscriptionmanager[action]',
            'valueMap' => 
            array (
              'confirmation' => 'confirm',
              'create' => 'create',
              'delete' => 'delete',
              'error' => 'error',
              'logout' => 'logout',
            ),
            'noMatch' => 'bypass',
          ),
          2 => 
          array (
            'GETvar' => 'tx_t3extblog_subscriptionmanager[code]',
          ),
        ),
        'subscription-blog' => 
        array (
          0 => 
          array (
            'GETvar' => 'tx_t3extblog_blogsubscription[action]',
          ),
        ),
      ),
    ),
  ),
);

Edit: Maybe there is something wrong with the rootpageId: If i edit the autoconf from rootpage id 1 to rootpage id 2 i get the following error: Page Not Found

Reason: Segment "fotografie" was not a keyword for a postVarSet as expected on page with id=2.

=> I assume the part id=2 comes from my rootpageId. Going back to my original error, i assume there is somehow a rootpageId of 0 specified (even if set rootpage_id = '1'

I have the following site structure:

id=0
|id=1 (Home; Redirect to id=2; marked as rootpage)
-|id=2 (Startseite)
-|id=3 (Fotografie)
-|id=4 (Grafikdesign)

I know this is not ideal, but with autoconf this structure is working, so i assume there must be a way to get this working with manual conf, without changig the structure (because i don't think this would be trivial)

fighter-ii
  • 479
  • 2
  • 6
  • 19
  • can you give the realurl_conf.php that has been generated in typo3conf folder? Anyway it may be related to rootpage id you may have to set it in the config. Will post a sample below i used for my site. – UnpassableWizard Dec 13 '17 at 16:51

1 Answers1

0

Try this very minimal config: The rootpage is defined also the domainname, this may work, but I always have trouble with realurl on diffeerent types of domain (local/sub/nregular) and caching of paths.

Paths cache can be flushed in the backend: Web > Speaking URL's > "select a page in tree" > Flush all Entries (harmful). Dont do this on an indexed site!

Hope this config works for you.

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
    '_DEFAULT' => array (
        'init' => array (
            'enableCHashCache' => '1',
            'appendMissingSlash' => 'ifNotFile',
            'enableUrlDecodeCache' => '1',
            'enableUrlEncodeCache' => '1',
        ),
        'redirects' => array (
        ),
        'pagePath' => array (
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => '7',
            'rootpage_id' => $rootpageId,
        ),
    ),
); 
switch($_SERVER['HTTP_HOST']) {
    case 'yourwebsite.com':
    case 'www.yourwebsite.com':
        $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = 'index.php?id=4';
        $TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'] = 'HTTP/1.0 404 Not Found';
        $rootpageId = 1;
    break;
} 
?>
UnpassableWizard
  • 1,237
  • 11
  • 20
  • Sorry for the late answer, was very busy at work. After replacing my own domainname, i'm still getting the same error as described before. Added my realurl_autoconf.php to my post – fighter-ii Dec 22 '17 at 08:23