TYPO3 - 404 пользовательских страницы никогда не отображаются, только 400 - PullRequest
0 голосов
/ 01 июня 2018

Ниже конфигурации моего сайта:

  • TYPO3 6,2
  • RealURL

У меня есть страница www.mysite.com/404/, это работав совершенстве.НО TYPO3 никогда не перенаправляет на него, когда появляется ошибка, я получаю страницу 400 Bad Request.

Я уже сделал:

  • отредактировал мой localconf.php

enter image description here

  • редактировать с помощью внутреннего модуля "All Configuration"

enter image description here

  • Изменить файл realurl_conf.php

enter image description here

Чего мне не хватает?

1 Ответ

0 голосов
/ 04 июня 2018

У меня всегда есть что-то вроде (в realurl_conf.php):

$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = 'index.php?id=35';
$TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'] = 'HTTP/1.0 404 Not Found';

Надеюсь, это поможет:)

ОБНОВЛЕНИЕ:

<?php


$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
    '_DEFAULT' => array (
        'init' => array (
            'enableCHashCache' => '1',
            'appendMissingSlash' => 'ifNotFile',
            'enableUrlDecodeCache' => '1',
            'enableUrlEncodeCache' => '1',
        ),
        'redirects' => array (
        ),
        'preVars' => array (
            '0' => array (
                'GETvar' => 'no_cache',
                'valueMap' => array (
                    'nc' => '1',
                ),
                'noMatch' => 'bypass'
            ),
            '1' => array (
                'GETvar' => 'L',
                'valueMap' => array (
                    'nl' => '0',
                    'en' => '2',
                    'de' => '1',
                ),
                'noMatch' => 'bypass',
            ),
            '2' => array (
                'GETvar' => 'lang',
                'valueMap' => array (
                    'de' => 'de',
                    'en' => 'en',
                    'nl' => 'nl'
                ),
                'noMatch' => 'bypass',
            ),
        ),
        'pagePath' => array (
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => '7',
            'rootpage_id' => $rootpageId,
        ),
        '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' => '-'
                                        )
                                )
                        )
                ),
                'CompanyDetailConfiguration' => array(
                        array(
                                'GETvar' => 'tx_dswmediacompanies_companies[action]',
                                'valueMap' => array(
                                        'detail' => '',
                                ),
                                'noMatch' => 'bypass'
                        ),
                        array(
                                'GETvar' => 'tx_dswmediacompanies_companies[controller]',
                                'valueMap' => array(
                                        'Companies' => '',
                                ),
                                'noMatch' => 'bypass'
                        ),
                        array(
                                'GETvar' => 'tx_dswmediacompanies_companies[uid]',
                                'lookUpTable' => array(
                                        'table' => 'tx_dswmediacompanies_domain_model_companies',
                                        'id_field' => 'uid',
                                        'alias_field' => 'name',
                                        '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,
                                )
                        )
                ),
                '15' => 'newsDetailConfiguration',
        ),
        'postVarSets' => array (
            '_DEFAULT' => array (
                'b' => array (
                    array (
                        'GETvar' => 'tx_example[uid]',
                        'lookUpTable' => array (
                            'table' => 'tx_dswmediacompanies_domain_model_companies',
                            'id_field' => 'uid',
                            'alias_field' => 'name',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => '1',
                            'useUniqueCache_conf' => array (
                                'strtolower' => '1',
                                'spaceCharacter' => '-',
                            ),
                        ),
                    ),
                    array (
                        'GETvar' => 'tx_example[action]',
                        'lookUpTable' => array (
                            'table' => 'tx_example_domain_model_companies',
                            'id_field' => 'uid',
                            'alias_field' => 'name',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => '1',
                            'useUniqueCache_conf' => array (
                                'strtolower' => '1',
                                'spaceCharacter' => '-',
                            ),
                        ),
                    ),  
                ),
                '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]',
                        ),
                ),
                // 'news' => 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' => '-',
                //             ),
                //         ),
                //     ),
                // ),
            ),
        ),
        'fileName' => array (
            'defaultToHTMLsuffixOnPrev' => false,
            'index' => array (
                'rss.xml' => array (
                    'keyValues' => array (
                        'type' => '100',
                    ),
                ),
                'rss2.xml' => array (
                    'keyValues' => array (
                        'type' => '101',
                    ),
                ),
                'rdf.xml' => array (
                    'keyValues' => array (
                        'type' => '102',
                    ),
                ),
                'atom.xml' => array (
                    'keyValues' => array (
                        'type' => '103',
                    ),
                ),
                'sitemap.xml' => array (
                    'keyValues' => array (
                        'type' => '841132',
                    ),
                ),
                'robots.txt' => array (
                    'keyValues' => array (
                        'type' => '841133',
                    ),
                ),
            ),
        ),
    ),
); 

switch($_SERVER['HTTP_HOST']) {
    case 'example.nl':
    case 'www.example.nl':
        $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;
    case 'othersite.nl':
    case 'www.othersite.nl':
        $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = 'index.php?id=68';
        $TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'] = 'HTTP/1.0 404 Not Found';
        $rootpageId = 23;
    break;
}


?>
...