aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-06-29 15:54:46 +0000
committerRomain d'Alverny <rda@mageia.org>2011-06-29 15:54:46 +0000
commitb6db535862a15c3b4473ab3b324878cbfa792283 (patch)
tree5417aa35c34af24c0b1d44711139dd0e339c753c /index.php
parent1de178d99e35dba18e7b506ab801149f2a388b2d (diff)
downloadwww-b6db535862a15c3b4473ab3b324878cbfa792283.tar
www-b6db535862a15c3b4473ab3b324878cbfa792283.tar.gz
www-b6db535862a15c3b4473ab3b324878cbfa792283.tar.bz2
www-b6db535862a15c3b4473ab3b324878cbfa792283.tar.xz
www-b6db535862a15c3b4473ab3b324878cbfa792283.zip
force www.mageia.org on / - redirect known mageia.* hosts to www.mageia.org
Diffstat (limited to 'index.php')
-rw-r--r--index.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/index.php b/index.php
index 4fd47cace..2d86636d6 100644
--- a/index.php
+++ b/index.php
@@ -5,6 +5,18 @@
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) {
+ header ('HTTP/1.1 301 Moved Permanently');
+ header(sprintf('Location: http://%s%s', $www_domain, $_SERVER['REQUEST_URI']));
+ die;
+} elseif (G_VHOST != $www_domain) {
+ domain_redirect($_SERVER['SERVER_NAME'], $domains_lang, $www_domain);
+}
+
if (isset($_GET['langs'])) { die(show_langs($langs)); }
if (isset($_GET['flang']))