public static function redirect($location, $stop_execution=true, $code=null) {
	if (preg_match('{^(http(s)?:)?//}', $location) == false) {
		$base_url  = 'http';
		$base_url .= !empty($_SERVER['HTTPS']) ? 's' : '';
		$base_url .= '://'.$_SERVER['SERVER_NAME'];
		
		if (strpos($location, '/') !== 0) {
			$base_url .= '/';
		}
		
		$location = $base_url.$location;
	}
	
	header('Location: '.$location, $replace=true, $code);
	
	if ($stop_execution == false) {
		return;
	}
	
	exit;
}