我在TYPO3 4.5.26上运行realURL 1.12.6
我习惯于使用realURL创建包含preVar的路径,也可以使用默认语言,例如www.example.com/de/seite/和www.example.com/en/page/
在一个案例中,这只是没有发生 - 或者我认为,只是有时候.在大多数情况下,我会访问www.example.com/seite/和www.example.com/en/page/
哪里可以改变?
PS:这是我的realurlconf的开头:
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'enableCHashCache' => 1,
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
'respectSimulateStaticURLs' => 0,
//'postVarSet_failureMode'=>'redirect_goodUpperDir',
),
'redirects_regex' => array (
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'en' => '1',
),
'valueDefault' => 'de',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
),
Run Code Online (Sandbox Code Playgroud)
如果我使用此配置(设置了valueDefault,noMatch not),则在调用www.domain.com/notexisting/someexistingpage/或www.domain.com/notexisting/等网址时不会触发404错误页面
只有在调用www.domain.com/notexisting/alsonotexistingpage/等网址时才会触发404页面
这意味着,realurl期望url的第一部分成为语言部分(此处:"notexisting"),如果realurl无法映射此键,则使用"valueDefault".但我想要触发404,我该怎么做呢?
编辑:我现在有解决方案:
realurl配置:
'GETvar' => 'L',
'valueMap' => array(
'en' => '0',
'de' => '1',
),
'noMatch' => 'bypass',
Run Code Online (Sandbox Code Playgroud)
TypoScript配置:
config.defaultGetVars.L = 0
config.linkVars = L
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6895 次 |
| 最近记录: |