File: D:/HostingSpaces/SBogers10/spire.komma-mediadesign.nl/wwwroot/index.php
<?php
$_SERVER['REQUEST_URI'] = str_replace("http://".$_SERVER['SERVER_NAME'], '',$_SERVER['REQUEST_URI']);
//// From Komma Mediadesign
//if( ($_SERVER['HTTP_HOST'] == "spire.komma-mediadesign.nl" || $_SERVER['HTTP_HOST'] == "www.spire.komma-mediadesign.nl")
// && $_SERVER['REMOTE_ADDR'] != '5.172.219.238'
//){
// $location = 'Location: http://www.spire-corp.com'.$_SERVER['REQUEST_URI'];
//
// header ('HTTP/1.1 301 Moved Permanently');
// header ($location);
// exit();
//}
// From spirechina.com
if($_SERVER['HTTP_HOST'] == "spirechina.com" || $_SERVER['HTTP_HOST'] == "www.spirechina.com"){
$location = 'Location: http://www.spire-corp.com'.$_SERVER['REQUEST_URI'];
header ('HTTP/1.1 301 Moved Permanently');
header ($location);
exit();
}
// From spire.nl
if($_SERVER['HTTP_HOST'] == "spire.nl" || $_SERVER['HTTP_HOST'] == "www.spire.nl"){
$location = 'Location: http://www.spire-corp.com'.$_SERVER['REQUEST_URI'];
header ('HTTP/1.1 301 Moved Permanently');
header ($location);
exit();
}
// From spirecoolers.com
if($_SERVER['HTTP_HOST'] == "spirecoolers.com" || $_SERVER['HTTP_HOST'] == "www.spirecoolers.com"){
$location = 'Location: http://www.spire-corp.com'.$_SERVER['REQUEST_URI'];
header ('HTTP/1.1 301 Moved Permanently');
header ($location);
exit();
}
// From spirecoolers.com.tw
if($_SERVER['HTTP_HOST'] == "spirecoolers.com.tw" || $_SERVER['HTTP_HOST'] == "www.spirecoolers.com.tw"){
$location = 'Location: http://www.spire-corp.com'.$_SERVER['REQUEST_URI'];
header ('HTTP/1.1 301 Moved Permanently');
header ($location);
exit();
}
if($_SERVER['HTTP_HOST'] == "spirex2.com" || $_SERVER['HTTP_HOST'] == "www.spirex2.com"){
$location = 'Location: http://www.x2products.com'.$_SERVER['REQUEST_URI'];
header ('HTTP/1.1 301 Moved Permanently');
header ($location);
exit();
}
// Has www ?
if(substr($_SERVER['HTTP_HOST'],0,3) != 'www')
{
header ('HTTP/1.1 301 Moved Permanently');
$location = 'http://www.' . $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header('location: ' . $location);
}
include 'init.php';
/*
* Load main controller in Template
*/
$Template->load($_SERVER['DOCUMENT_ROOT'].'/mvc/controllers/c_main.php','');
/*
* Check if the URL_PAGE (get variable) is set.
* If not, then load home page.
*/
if(defined('URL_PAGE') && URL_PAGE != '')
{
/*
* Set page_name data
* page_name is being used as class_name in header & footer
*/
$Template->setData('page_name',URL_PAGE);
/*
*
* Check if page is allowed.
* If so, include the controller in the template. Else header a 404-error.
*/
if(in_array(URL_PAGE,$allowedPages))
{
$page = str_replace('-','_',URL_PAGE);
$Template->load('mvc/controllers/c_'.$page.'.php');
}
else{
$Template->notFound();
}
}
else{
$Template->setData('page_name','home');
$Template->load('mvc/controllers/c_home.php', SITE_NAME);
}
/*
* Load Views
*/
$Template->load('mvc/views/includes/v_base.php');
$Template->load($Template->getData('content_view_path',FALSE));
$Template->load('mvc/views/includes/v_footer.php');