Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 打字3-404自定义页面从不显示,仅显示400_Typo3_Typo3 6.2.x_Realurl - Fatal编程技术网

Typo3 打字3-404自定义页面从不显示,仅显示400

Typo3 打字3-404自定义页面从不显示,仅显示400,typo3,typo3-6.2.x,realurl,Typo3,Typo3 6.2.x,Realurl,以下是我的网站配置: 类型3.6.2 RealURL 我有一个www.mysite.com/404/页面,非常好用。 但TYPO3从不重定向到它,当出现错误时,我会得到一个400错误请求页面 我已经做到了: 编辑我的localconf.php 通过“所有配置”后端模块进行编辑 编辑realurl_conf.php 我遗漏了什么?我总是有这样的东西(在realurl_conf.php中): 希望有帮助:) 更新: <?php $GLOBALS['TYPO3_CONF

以下是我的网站配置:

  • 类型3.6.2
  • RealURL
我有一个www.mysite.com/404/页面,非常好用。 但TYPO3从不重定向到它,当出现错误时,我会得到一个
400错误请求
页面

我已经做到了:

  • 编辑我的localconf.php

  • 通过“所有配置”后端模块进行编辑

  • 编辑realurl_conf.php


我遗漏了什么?

我总是有这样的东西(在realurl_conf.php中):

希望有帮助:)

更新:

<?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;
}


?>
数组(
“keyValues”=>数组(
'类型'=>'100',
),
),
'rss2.xml'=>数组(
“keyValues”=>数组(
'类型'=>'101',
),
),
'rdf.xml'=>数组(
“keyValues”=>数组(
'类型'=>'102',
),
),
'atom.xml'=>数组(
“keyValues”=>数组(
'类型'=>'103',
),
),
'sitemap.xml'=>数组(
“keyValues”=>数组(
'类型'=>'841132',
),
),
'robots.txt'=>数组(
“keyValues”=>数组(
'类型'=>'841133',
),
),
),
),
),
); 
交换机($\u服务器['HTTP\u主机'])){
案例“example.nl”:
案例“www.example.nl”:
$TYPO3_CONF_VARS['FE']['pageNotFound_handling']='index.php?id=4';
$TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader']='HTTP/1.0 404 notfound';
$rootpageId=1;
打破
案例“othersite.nl”:
案例“www.othersite.nl”:
$TYPO3_CONF_VARS['FE']['pageNotFound_handling']='index.php?id=68';
$TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader']='HTTP/1.0 404 notfound';
$rootpageId=23;
打破
}
?>

Hello Rustyjim,我添加了这些行,但没有效果。我甚至试图在.htaccess中添加“errordocument404/404”,但什么也没有。这可能是服务器的错误配置吗?(vhost配置等)很抱歉迟了回复。要我发布我的完整realurl_conf吗?或者问题已经解决了/还有其他问题吗?您好@Rustyjim,URL
www.my-website.com/404
工作正常。。。似乎TYPO3不明白,如果请求错误的url,他必须使用它:(我将使用完整配置进行更新,以显示它如何为我们工作
<?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;
}


?>