From b6db535862a15c3b4473ab3b324878cbfa792283 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 29 Jun 2011 15:54:46 +0000 Subject: force www.mageia.org on / - redirect known mageia.* hosts to www.mageia.org --- index.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'index.php') 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'])) -- cgit v1.2.1