更改语言时真实网址仅显示index.php?id=xx

发布于 2024-12-17 08:47:50 字数 2311 浏览 6 评论 0原文

如果我查看我的默认语言,链接会显示 URL (www.yoursite.com/company/about-us.html)。但现在我添加了一种语言,如果我查看链接,我会得到

www.yoursite.com/index.php?id=63&L=1

有什么问题吗?这是我的列表菜单的打字稿:

lib.tsfootermenu1 = COA
lib.tsfootermenu1 {

  10 = HTML
  10.value = <p class="ContentOverviewHeading">


  15 < tmp.tsfootermenu1

  20 = HTML
  20.value = </p>

  25 = HMENU
  25  {
    special = directory
    special.value = 63
    entryLevel = 0

    1 = TMENU
    1.wrap = <ul>|</ul>
    1{
        expAll = 0
        NO{
          ATagTitle.field = title
          wrapItemAndSub = <li>|</li>
          ATagParams = class="SubMenu1"
        }
    }
  }
}

TS 读出文件夹中的所有元素并显示一个列表。我已经为该文件夹及其中的元素添加了页面翻译,但我仍然得到了index.php?id=xx URL。当然我清除了真实的url和页面缓存。

编辑:

我的 realURL 配置:

$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 (
                'de' => '0',
                'en' => '2',
                'valueDefault' => 'de',
            ),
            'noMatch' => 'bypass',
        ),
        '2' => array (
            'GETvar' => 'lang',
            'valueMap' => array (
                'de' => 'de',
                'en' => 'en',
            ),
            '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' => '1',
    )

编辑:
我的解决方案看起来像是我将完整配置更改为 L=2。 Typo3 显然存在一些被删除的语言的问题。

If I look at my default language the links have speaking url (www.yoursite.com/company/about-us.html). But now I added a language and if I look at the links I get

www.yoursite.com/index.php?id=63&L=1

What is wrong? This is my Typoscript for the list menu:

lib.tsfootermenu1 = COA
lib.tsfootermenu1 {

  10 = HTML
  10.value = <p class="ContentOverviewHeading">


  15 < tmp.tsfootermenu1

  20 = HTML
  20.value = </p>

  25 = HMENU
  25  {
    special = directory
    special.value = 63
    entryLevel = 0

    1 = TMENU
    1.wrap = <ul>|</ul>
    1{
        expAll = 0
        NO{
          ATagTitle.field = title
          wrapItemAndSub = <li>|</li>
          ATagParams = class="SubMenu1"
        }
    }
  }
}

The TS reads out all elements in a folder and shows a list. I have added a page translation for the folder and the elements in it, but I still get the index.php?id=xx URL. Of course I cleared the real url and page cache.

Edit:

My realURL config:

$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 (
                'de' => '0',
                'en' => '2',
                'valueDefault' => 'de',
            ),
            'noMatch' => 'bypass',
        ),
        '2' => array (
            'GETvar' => 'lang',
            'valueMap' => array (
                'de' => 'de',
                'en' => 'en',
            ),
            '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' => '1',
    )

Edit:
My solution looked like I changed the complete config to L=2. Typo3 has obviously some problems with a deleted language.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七色彩虹 2024-12-24 08:47:50

至少您没有在 Realurl 配置中定义 L=1 的映射,仅定义 L=0 或 L=2 。

At least you did not define an mapping for L=1, only L=0 or L=2 in your Realurl config.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文