diff options
author | Thomas Backlund <tmb@mageia.org> | 2014-10-12 12:27:45 +0300 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2014-10-12 12:27:45 +0300 |
commit | 9ce6d646ff718cd62f6434c9a4c94e450436612a (patch) | |
tree | 3ee82e5db7c0aee44a5573d9d17035c6ecac697d /index.php | |
parent | a0b2d09125d7911656fe4cb286f20643c4432281 (diff) | |
download | www-9ce6d646ff718cd62f6434c9a4c94e450436612a.tar www-9ce6d646ff718cd62f6434c9a4c94e450436612a.tar.gz www-9ce6d646ff718cd62f6434c9a4c94e450436612a.tar.bz2 www-9ce6d646ff718cd62f6434c9a4c94e450436612a.tar.xz www-9ce6d646ff718cd62f6434c9a4c94e450436612a.zip |
Revert "Updated Estonian translation"
This reverts commit a0b2d09125d7911656fe4cb286f20643c4432281.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/index.php b/index.php new file mode 100644 index 000000000..6aa178cec --- /dev/null +++ b/index.php @@ -0,0 +1,50 @@ +<?php +/** + * +*/ + +require_once 'langs.inc.php'; + +// NOTE, this should go to the main controller in the next platform +// (catching all requests) +$domain = 'mageia.org'; +$www_domain = 'www.' . $domain; + +if (G_VHOST == $domain) { + // rewrite "//mageia.org/" to "//www.mageia.org/" + header ('HTTP/1.1 301 Moved Permanently'); + header(sprintf('Location: //%s%s', $www_domain, $_SERVER['REQUEST_URI'])); + die; +} +elseif (isset($_GET['fromtld'])) { + // rewrite "//mageia.org/?fromtld=it" to "//www.mageia.org/it/" + tld_redirect($_GET['fromtld'], $domains_lang, $www_domain); +} +elseif (G_VHOST != $www_domain) { + // rewrite "//mageia.it/" to "//www.mageia.org/it/" + domain_redirect($_SERVER['SERVER_NAME'], $domains_lang, $www_domain); +} + +if (isset($_GET['langs'])) { + die(show_langs($langs)); +} + +if (isset($_GET['flang'])) +{ + $lang = array_key_exists($_GET['flang'], $langs) ? $_GET['flang'] : 'en'; + if (isset($_GET['furl'])) + { + $url = explode('/', $_GET['furl']); + array_shift($url); + array_shift($url); + $url = '/' . $lang . '/' . implode($url, '/'); + //$url = substr_replace($_GET['furl'], $lang, 1, 2); + } + else + $url = '/' . $lang . '/'; + + header(sprintf('Location: %s', $url)); + die; +} + +relocate($langs);
\ No newline at end of file |