Hello,Oliver Georgi wrote:If you use multiple languages in phpwcms like this:
HOME
- de
- en
- fr
and you want to use language based redirection fill in these lines of code in header section of default template
Enhance the other languages like "case 'de':"Code: Select all
[PHP] if(!$GLOBALS['aktion'][0]) { switch( strtolower( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) ) ) { case 'de': header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?de'); exit(); break; default: header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?en'); exit(); } } [/PHP]
Oliver
I use this function in 1.1.4.
Does it work in 1.2.1-DEV?
I try it in template/header block, but there is no result

Code: Select all
[PHP]
if(!$GLOBALS['aktion'][0]) {
switch( strtolower( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) ) ) {
case 'hu': header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?lang,hu');
exit();
break;
default: header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?lang,en');
exit();
}
}
[/PHP]