system/HTTP/RedirectResponse.php
public function to(string $uri, int $code = null, string $method = 'auto')
	{
		// If it appears to be a relative URL, then convert to full URL
		// for better security.
		if (strpos($uri, 'http') !== 0)
		{
			$url = current_url(true)->resolveRelativeURI($uri);
			$uri = (string)$url;
		}

		return $this->redirect($uri, $method, $code);
	}
public function to(string $uri, int $code = null, string $method = 'auto')
	{
		// If it appears to be a relative URL, then convert to full URL
		// for better security.
		if (strpos($uri, 'http') !== 0)
		{
			$url = current_url(true)->resolveRelativeURI($uri);
			$uri = (string)$url;
		}

		return $this->redirect($uri, $method, $code);
	}
Sets the URI to redirect to and, optionally, the HTTP status code to use.
If no code is provided it will be automatically determined.

@param string       $uri    The URI to redirect to
@param integer|null $code   HTTP status code
@param string       $method

@return $this