<?php
include("config.inc.php");
$domain = $_SERVER['SERVER_NAME'];

function checkForSubdomain($domain){
	if(!substr_count($domain, '.'))
		return false;
	elseif(substr_count($domain, '.') == 1){
		return true;
	} elseif(substr_count($domain, '.') > 1){
		$found = substr($domain, 0,strpos($domain,"."));
		if($found){	return false; }
	}
}

if(!substr_count($domain, 'www.')){
	if(checkForSubdomain($domain)){	header("Location:https://www.$domain".$_SERVER['REQUEST_URI']); }
}

require("core/db.class.inc.php");
require("core/formating.inc.php");
$DB = new mxDb($DBHOST, $DBNAME, $DBUSER, $DBPASS);

require("core/common.inc.php");

$sql = "SELECT * FROM ".$DB->pre."admin_site_meta WHERE sitePage = '/home'";
$H = $DB->dbRow($sql);
$METADATAARR['home'] = $H['metaTitle'];
$METADATAARR['other'] = $H['metaTitle'];
$METADATAARR['description'] = $H['metaDesc'];
$METADATAARR['keyword'] = $H['metaKeyword'];
?>