<?php
ob_start();

// Inclusion des librairies
require ('lib/aeos.lib.php');
require ('lib/config.lib.php');
require ('lib/var.lib.php');

//Check Install
checkInstall();

// URL Rewriting
if(isset($_GET['redirect']))
{
	if (preg_match("#".AEOS_REW."([0-9-]+)-([^0-9](?:.+))#isU", $_SERVER['REDIRECT_URL'], $redirect)) 
	{
		header("Status: 200 OK", false, 200);
		$redirect=abs($redirect[1]);
		require ('lib/config.lib.php');
		require ('lib/var.lib.php');
	}
	else header('Location: '.AEOS_REW.HOME_PAGE.'-E404.html');
}
?>
<!DOCTYPE html>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title><?php echo AEOS_NAME." | ".AEOS_TITLE; ?></title>
	<meta name="description" content="<?php echo AEOS_DESC; ?>" />
	<link rel="stylesheet" type="text/css" media="screen" href="themes/<?php echo AEOS_THEME; ?>/styles.css" />
	<link rel="icon" type="image/png" href="themes/<?php echo AEOS_THEME; ?>/images/favicon_aeos.ico" />


<?php
// Maintenance ou non
if (AEOS_MAINTENANCE=="on"){require_once('themes/'.AEOS_THEME.'/maintenance.php');}
else {require_once('themes/'.AEOS_THEME.'/base.php');}
ob_end_flush();
?>
