header('Location: http://theafh.net/' , true, 301);
die();
$GLOBALS['AFH_LIB_PATH'] = "/home/project/code/php/afh-lib-dev/";
require_once($GLOBALS['AFH_LIB_PATH'].'inc.common_web_functions.php');
require_once($GLOBALS['AFH_LIB_PATH'].'inc.html_processing.php');
require_once($GLOBALS['AFH_LIB_PATH'].'inc.ua.php');
require_once($GLOBALS['AFH_LIB_PATH'].'inc.www_fetching.php');
//$GLOBALS['BASEDIR']      = '/var/www/vhosts/www.vwp-online.de/html/';
//$ids_arr = log_raw_web_request_to_file();
$args['cache']           = '7d';
//$args['cache_path']      
$args['ua']              = 'ODM (Old Domain Mirror) v0.1';
if(strpos($_SERVER['REQUEST_URI'],'feed') !== false){
	$args['url']             = 'http://theafh.net/feed/';
	//header('Content-type: application/rss+xml');
	//$ret = curl_comunicate($args);
	header("Location:".$args['url']);
	exit;
}
else{
	//$ajax    = build_ajax_log_str($ids_arr['req_id']);
	$args['url']             = 'http://theafh.net/';
	$ret = curl_comunicate($args);
	$out = $ret['output'];
	//$out = $ret['output'];
	//print_r($ret);
	$out = str_replace('',"\n",$out);
	$out = preg_replace('//iUs', '', $out); // remove tracking iframe
}
if(
	(strpos($_SERVER['REQUEST_URI'], 'wp-login') === false) &&
	(is_bot($_SERVER['HTTP_USER_AGENT']) === false) &&
	(strpos($_SERVER['REQUEST_URI'], 'user-agents') === false)
){
	echo $out;
}
else{
	slow_echo($out);
}
?>