index: Add /de/ and /en/ versions
This commit is contained in:
@ -1,6 +1,23 @@
|
||||
<?php
|
||||
header("Content-Length: 0");
|
||||
switch ($_SERVER['PATH_INFO']) {
|
||||
case '':
|
||||
case '/':
|
||||
$lang = 'de'; // prefer german
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $pref) {
|
||||
$l = substr($pref, 0, 2);
|
||||
if ($l === 'de') {
|
||||
$lang = 'de';
|
||||
break; // force german
|
||||
} else if ($l === 'en') {
|
||||
$lang = 'en'; // use english only, if user specifically asks for it
|
||||
}
|
||||
}
|
||||
}
|
||||
header("Status: 303");
|
||||
header("Location: /$lang/");
|
||||
break;
|
||||
case '/changelog':
|
||||
header("Status: 303");
|
||||
header("Location: https://git.necronda.net/winzer/elwig/src/branch/main/CHANGELOG.md");
|
||||
|
Reference in New Issue
Block a user