2015-02-11 32 views
0

我有以下RealURL擴展不是TYPO3 v6.2.x工作時域給出IP地址

Web Tree Structure

給出此樹,當我訪問諸如http://localhost/mysite其重定向到「根網頁樹結構本地「,像http://192.168.1.20/mysite/那樣通過在域中設置它重定向到」根IP「來訪問。

我實現了realURL擴展。它工作正常localhost和URL成爲http://localhost/mysite/en/home/

但是當我試圖通過192.168.1.20作爲域訪問它時,URL顯示爲http://192.168.1.20/mysite/en/home/。 柏迪它顯示了錯誤空白網頁「此網頁有重定向循環」。

realurl_conf.php看起來像

<?php 

    $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
    // sitename 
    '_DEFAULT' => array(
     // initialization 
     'init' => array(
     'useCHashCache' => '0', // für tt_news 
     'enableCHashCache' => true, 
     'appendMissingSlash' => 'ifNotFile', 
     'enableUrlDecodeCache' => true, 
     'enableUrlEncodeCache' => true, 
     'emptyUrlReturnValue' => '/' 
    ), 
     // first url rewriting segment 
     'preVars' => array(
     array(
      'GETvar' => 'L', 
      'valueMap' => array(
      'de' => 3, 
      'en' => 1, 

     ), 
      'valueDefault' => 1, 
     ), 
    ), 
     // second url rewriting segment 
     'pagePath' => array(
     'type' => 'user', 
     'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', 
     'spaceCharacter' => '-', 
     'languageGetVar' => 'L', 
     'expireDays' => 30, 
     'rootpage_id' => 1 
    ), 
     // third url rewriting segment 
     'fixedPostVars' => array(
    ), 
     // forth url rewriting segment 
     'postVarSets' => array(
     '_DEFAULT' => array(
      /* 
       no_cache setting should not be used in preVars 
       @see http://dmitry-dulepov.com/article/do-not-use-no-cache-as-prevar.html 
      */ 
      'nc' => array(
      'type' => 'single', 
      'GETvar' => 'no_cache', 
     ), 

     ) 
    ), 

    ) 
); 

    $byPassLVar = array(
    array(
     'GETvar' => 'L', 
     'valueMap' => array(), 
     'noMatch' => 'bypass' 
    ) 
); 


    $TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_Local'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']; 
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_Local']['pagePath']['rootpage_id'] = 1; 
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_Local']['preVars'] = $byPassLVar; 
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_IP'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['192.168.1.20']; 
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_IP']['pagePath']['rootpage_id'] = 3; 
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_IP']['preVars'] = $byPassLVar; 



    switch (t3lib_div::getIndpEnv('HTTP_HOST')) { 
    case 'Root_Local': 
    $_GET['L'] = 1; 
    break; 
    case 'Root_IP': 
    $_GET['L'] = 1; 
    break; 
    default: 
    $_GET['L'] = 1; 
    break; 
    } 

?> 

我在主模板

config.simulateStaticDocuments = 0 
    config.baseURL = http://192.168.1.20/mysite/ 
    config.tx_realurl_enable = 1 

的IP地址和

config.simulateStaticDocuments = 0 
    config.baseURL = http://localhost/mysite/ 
    config.tx_realurl_enable = 1 

增加了對本地主機

爲什麼它不適用於作爲域名的IP地址? 我該如何使它工作? 在此先感謝

回答

0

最後,我自己找到了答案。我不完全知道它是如何工作的。如果有人可以幫助我,請自由添加。

我修改了realurl_conf.php這樣並像一個魅力的作品..

<?php 

    $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
    // sitename 
    '_DEFAULT' => array(
     // initialization 
     'init' => array(
     'useCHashCache' => '0', 
     'enableCHashCache' => true, 
     'appendMissingSlash' => 'ifNotFile', 
     'enableUrlDecodeCache' => true, 
     'enableUrlEncodeCache' => true, 
     'emptyUrlReturnValue' => '/' 
    ), 
     // first url rewriting segment 
     'preVars' => array(
     array(
      'GETvar' => 'L', 
      'valueMap' => array(
      'de' => 3, 
      'en' => 1, 

     ), 
      'valueDefault' => 'en', 
     ), 
    ), 
     // second url rewriting segment 
     'pagePath' => array(
     'type' => 'user', 
     'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', 
     'spaceCharacter' => '-', 
     'languageGetVar' => 'L', 
     'expireDays' => 30, 
     'rootpage_id' => 1 
    ), 
     // third url rewriting segment 
     'fixedPostVars' => array(
    ), 
     // forth url rewriting segment 
     'postVarSets' => array(
     '_DEFAULT' => array(
      /* 
       no_cache setting should not be used in preVars 
       @see http://dmitry-dulepov.com/article/do-not-use-no-cache-as-prevar.html 
      */ 
      'nc' => array(
      'type' => 'single', 
      'GETvar' => 'no_cache', 
     ), 

     ) 
    ), 

    ) 
); 

    $TYPO3_CONF_VARS['EXTCONF']['realurl']['192.168.1.20'] = array(
    // sitename 

     // initialization 
     'init' => array(
     'useCHashCache' => '0', 
     'enableCHashCache' => true, 
     'appendMissingSlash' => 'ifNotFile', 
     'enableUrlDecodeCache' => true, 
     'enableUrlEncodeCache' => true, 
     'emptyUrlReturnValue' => '/' 
    ), 
     // first url rewriting segment 
     'preVars' => array(
     array(
      'GETvar' => 'L', 
      'valueMap' => array(
      'de' => 3, 
      'en' => 1, 

     ), 
      'valueDefault' => 'en', 
     ), 
    ), 
     // second url rewriting segment 
     'pagePath' => array(
     'type' => 'user', 
     'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', 
     'spaceCharacter' => '-', 
     'languageGetVar' => 'L', 
     'expireDays' => 30, 
     'rootpage_id' => 3 
    ), 
     // third url rewriting segment 
     'fixedPostVars' => array(
    ), 
     // forth url rewriting segment 
     'postVarSets' => array(
     '192.168.1.20' => array(
      /* 
       no_cache setting should not be used in preVars 
       @see http://dmitry-dulepov.com/article/do-not-use-no-cache-as-prevar.html 
      */ 
      'nc' => array(
      'type' => 'single', 
      'GETvar' => 'no_cache', 
     ), 
     ) 
    ), 
); 

    $byPassLVar = array(
    array(
     'GETvar' => 'L', 
     'valueMap' => array(), 
     'noMatch' => 'bypass' 
    ) 
); 


$TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_Local'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']; 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_Local']['pagePath']['rootpage_id'] = 1; 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_Local']['preVars'] = $byPassLVar; 

$TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_IP'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['192.168.1.20']; 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_IP']['pagePath']['rootpage_id'] = 3; //overwrite root page ID with the one for this specific domain 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['Root_IP']['preVars'] = $byPassLVar; 



    switch (t3lib_div::getIndpEnv('HTTP_HOST')) { 
     case 'Root_Local': 
    case 'Root_Local': 
    $_GET['L'] = 1; 
    break; 
    case 'Root_IP': 
    case 'Root_IP': 
    $_GET['L'] = 1; 
    break; 
    default: 
    $_GET['L'] = 1; 
    break; 
    } 

?> 

謝謝。