Re: Multiple Languages
Posted: Tue Aug 30, 2016 1:52 pm
Yes i do.
Code: Select all
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
$str = $_SERVER['REQUEST_URI']; $str2 = substr($str, 3);
if (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'fr')) {
header("Location: http://www.domain.com/fr".$str."");
exit;
} elseif (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de')) {
header("Location: http://www.domain.com/de".$str."");
exit;
.....
} else {
header("Location: http://www.domain.com/en".$str."");
exit;
}
}
Code: Select all
PHP Notice: Undefined index: HTTP_REFERER in /data/www/domain.com/html/scj/cgi/common.php on line 16
PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 47
Code: Select all
/data/www/pornyep.com/html/kli/cgi/common.php on line 58
[Mon Oct 24 20:44:16.087267 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 61
[Mon Oct 24 20:44:16.087271 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 64
[Mon Oct 24 20:44:16.087275 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 67
[Mon Oct 24 20:44:16.087279 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 70
[Mon Oct 24 20:44:16.087284 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 73
Code: Select all
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
$str = $_SERVER['REQUEST_URI']; $str2 = substr($str, 3);
if (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'fr')) {
header("Location: http://www.domain.com/fr".$str."");
exit;
} elseif (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de')) {
header("Location: http://www.domain.com/de".$str."");
exit;
.....
} else {
header("Location: http://www.domain.com/en".$str."");
exit;
}
}Code: Select all
if (!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = '';
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $_SERVER['HTTP_ACCEPT_LANGUAGE'] = '';
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
$str = $_SERVER['REQUEST_URI']; $str2 = substr($str, 3);
if (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'fr')) {
header("Location: http://www.domain.com/fr".$str."");
exit;
} elseif (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de')) {
header("Location: http://www.domain.com/de".$str."");
exit;
....
} else {
header("Location: http://www.domain.com/en".$str."");
exit;
}
}
Code: Select all
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {