【问题标题】:Typo3 realurl wrong defaultValue in links after clearCache清除缓存后链接中的 Typo3 realurl 错误 defaultValue
【发布时间】:2012-06-05 09:32:49
【问题描述】:

我正在运行 Typo3 4.5.12 和 realurl 扩展版本 1.11.1。 我的网站有 3 种语言 de、en、ch,默认语言是 de、German。

如果我清除 realurl 的缓存并首先调用 www.example.com/site 一切正常。

但是,如果我首先在 clearCache 之后调用例如带有语言参数的 url,例如 www.example.com/en/site,然后在 www.example.com/site 之后,所有链接都会得到 ../en/..在 www.example.com/en/site2 之类的 href 标记中。

当我在 clearCache 后第一次调用带有 ../ch/.. 或 ../de/.. 的站点时,情况相同

为什么当我在链接中调用 www.example.com/site 时他不选择默认语言?

我的realurl配置:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
    init' => array(
        'enableCHashCache' => 1,
        'appendMissingSlash' => 'ifNotFile',
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
        'respectSimulateStaticURLs' => 0,
    ),
    'redirects_regex' => array (
    ),
    'preVars' => array(
        array(
            'GETvar' => 'no_cache',
            'valueMap' => array('no_cache' => 1),
            'noMatch' => 'bypass',
        ),
        array(
            'GETvar' => 'L',
            'valueMap' => array(
                'de' => '0',
                'en' => '1',
                'cn' => '2',
            ),
            'defaultValue' => 'de',
            'noMatch' => 'bypass',
        ),
    ),
...

我的页面配置:

simulateStaticDocuments = 0
tx_realurl_enable = 1
prefixLocalAnchors = all

linkVars = mobile(off),L
uniqueLinkVars = 1

sys_language_uid = 0
language = de
locale_all = de_DE.UTF-8

sys_language_mode = content_fallback
sys_language_overlay = 1

【问题讨论】:

    标签: typo3 realurl


    【解决方案1】:
    [...]
    'defaultValue' => 'de',
    'noMatch' => 'bypass',
    [...]
    

    有点反字典。

    取出noMatch,这将创建如下网址:

    /site1 (german)
    /en/site1 (english)
    /cn/site1 (chinese)
    

    否则就去

    'noMatch' => 'de' //(without `'defaultValue' => 'de'`)
    

    得到

    /de/site1 (german)
    /en/site1 (english)
    /cn/site1 (chinese)
    

    【讨论】:

    • 嗨@konsolenfreddy - 我与当前的realURL 有类似/相同的问题,但您的解决方案'nomatch' => 'de' 不起作用。您仍然建议获取 /de/site1、/en/site1 等吗?
    • 这里似乎有些混淆,第一个设置为第二个示例创建了结果,参见。 stackoverflow.com/questions/17109737/…
    猜你喜欢
    • 2017-03-25
    • 2014-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-11
    • 2011-08-21
    • 2014-10-13
    • 1970-01-01
    相关资源
    最近更新 更多