public static function redirect($url, $status = 307){

		if(!in_array($status, [300, 301, 302, 303, 307])){

			$status = 307;
		}

		$url = trim($url);

		// Append base URL to a relative path

		if(strtolower(substr($url, 0, 4)) != 'http'){

			$base_url = self::detectBaseURL();

			// Unable to detect the base URL

			if(empty($base_url)){

				self::message(500, 'Unable to detect base URL');
				return;
			}

			$url = $base_url . ltrim($url, '/');
		}

		// Check target URL

		$url = self::normaliseURL($url);

		if($url == ''){

			self::message(500, 'Invalid URL provided for redirect operation');
			return;
		}

		// Automatic redirect

		if($status != HTTP::MULTIPLE_CHOICES){

			self::status($status);

			header("Location: $url");
		}

		// Manual redirect

		else{

			self::status(HTTP::MULTIPLE_CHOICES);

			// Prevent the notification page from being cached

			header('Cache-Control: no-cache, must-revalidate');
			header('Expires: Sat, 26 Jul 1997 05:00:00 CEST');
		}

		?>

			<html>
				<head>
					<title>This Page has Moved</title>
				</head>
				<body>
					<h1>This Page has Moved</h1>
					<p>
						The page you have requested has moved to another
						location.
					</p>
					<p>
						If you are not automatically redirected to
						<a href="<?= $url ?>">the page's new location</a>,
						please click <a href="<?= $url ?>">here</a> to do so
						manually.<br>
						If you keep seeing this message, or are otherwise unable
						to reach the new location, please return to
						<a href="/">our homepage</a> and attempt to
						reach the page from there.
					</p>
				</body>
			</html>

		<?php
	}