簡體   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