繁体   English   中英

如何使用扩展RealURL

[英]how to use the extension RealURL

我想在我的网站中使用扩展RealURL,将其安装在扩展中,这是我的配置文件:

    <?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array ( 
    '_DEFAULT' => array (
        'init' => array (
            'enableCHashCache' => '1',
            'appendMissingSlash' => 'ifNotFile',
            'enableUrlDecodeCache' => '1',
            'enableUrlEncodeCache' => '1',
            'emptyUrlReturnValue' => '/',
        ),
        'redirects' => array (
//          'de/aerzte.html' => '/?id=51&L=3',
        'support.html' => 'go/support-active'
        ),
        'preVars' => array (
            '0' => array (
                'GETvar' => 'no_cache',
                'valueMap' => array (
                    'nc' => '1',
                ),
                'noMatch' => 'bypass'
            ),
            '1' => array (
                'GETvar' => 'L',
                'valueMap' => array (
                    'de' => '3',
                    'en' => '0',
                    'fr' => '6',
//                    '_DEFAULT' => '0',
                ),
                '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' => 3,
        ),
        'fixedPostVars' => array (
        ),
        'postVarSets' => array (

            '_DEFAULT' => array (

        // EXT:news start
        'news' => array(
                array(
                        'GETvar' => 'tx_news_pi1[action]',
                ),
                array(
                        'GETvar' => 'tx_news_pi1[controller]',
                ),
                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,
                        ),
                ),
        ),
        // EXT:news end                


            ),
        ),
        'fileName' => array (
//
// if you don't want .html-URLs set the following to "false" (e.g. 'defaultToHTMLsuffixOnPrev' => false,)
// then you get http://www.yourdomain.com/imprint/ instead of http://www.yourdomain.com/imprint.html
//
            'defaultToHTMLsuffixOnPrev' => false,
            'index' => array (
                'rss.xml' => array (
                    'keyValues' => array (
                        'type' => '100',
                    ),
                ),
                'rss091.xml' => array (
                    'keyValues' => array (
                        'type' => '101',
                    ),
                ),
                'rdf.xml' => array (
                    'keyValues' => array (
                        'type' => '102',
                    ),
                ),
                'atom.xml' => array (
                    'keyValues' => array (
                        'type' => '103',
                    ),
                ),
            ),
        ),
    ),

); 


$domains = array(
    '_DEFAULT' => '3',
);
foreach ($domains as $domain=>$pid) {
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain]['pagePath']['rootpage_id'] = $pid;
}
//$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.****.com']['pagePath']['rootpage_id'] = 3;
?> 

我排除了网址中不需要的页面,删除了所有条目,发现网址已更改,但页面不再打开。 我刷新了三个缓存。 先感谢您。 编辑:这是我的网址https:// www .com / en / blog / blog / article /我去了第一个博客,并将其从口语URL中排除,第二个我将其设置为覆盖整个页面路径,在文章中,我也将其从口语URL中排除,然后转到文章条目并删除所有条目,然后此链接可以正常工作: https:// www .com / en / blog / article /,但不是: https:// www 。***。com / en / blog我在两个博客页面的扩展名中都得到了此名称:检测到URL冲突:'en / blog /'为也用于页面:865(/ Home / Blog)检测到URL冲突:'de / blog /'也用于页面:722(/ Home / Blog / Blog)

要使用TYPO3 RealURL扩展,您需要使用以下配置。

在setup.ts中添加以下排字。

config.simulateStaticDocuments = 0
config.tx_realurl_enable = 1

如果您的根目录中没有.htaccess文件,请添加它。

检查您的apache配置,如果未启用mod_rewrite启用它。

在Linux上启用下面的mod_rewrite use命令。

a2enmod rewrite
service apache2 restart

使用以下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,
            'useUniqueCache_conf' => array(
              'strtolower' => 1,
              'spaceCharacter' => '-'
            ),
            'languageGetVar' => 'L',
            'languageExceptionUids' => '',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l10n_parent',
            'expireDays' => 180,
          )
        )
    ),
    'blog-page-id' => 'newsDetailConfiguration',
),

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM