Redirect client browser to another place by `"Location: ..."`
header and call `\MvcCore\Application::GetInstance()->Terminate();`.
@param string $location
@param int	$code
@return void
775843
public static function Redirect ($location = '', $code = \MvcCore\IResponse::SEE_OTHER) {
		$app = & \MvcCore\Application::GetInstance();
		$app->GetResponse()
			->SetCode($code)
			//->SetHeader('Refresh', '0;url='.$location);
			->SetHeader('Location', $location);
		foreach (self::$allControllers as & $controller)
			$controller->dispatchState = 5;
		$app->Terminate();
	}
1314623
public function setLocation( Location $location )
    {
        foreach ( $this->handlers as $handler )
        {
            if ( $handler instanceof LocationAwareHandlerInterface )
            {
                $handler->setLocation( $location );
            }
        }
    }
511297
public function isRedirection(int $code): bool
    {
        return $this->statusExists($code) && ($this->extractFirstDigit($code) == self::CLASS_REDIRECTION);
    }
832383
protected function checkCategoryRedirect(Location $location): ?RedirectResponse
    {
        $content = $location->content;

        $internalRedirectContent = null;
        if (!$content->getField('internal_redirect')->isEmpty()) {
            $internalRedirectContent = $content->getFieldRelation('internal_redirect');
        }

        $externalRedirectValue = $content->getField('external_redirect')->value;

        if ($internalRedirectContent instanceof Content) {
            if ($internalRedirectContent->contentInfo->mainLocationId !== $location->id) {
                return new RedirectResponse(
                    $this->router->generate($internalRedirectContent),
                    RedirectResponse::HTTP_MOVED_PERMANENTLY
                );
            }
        } elseif ($externalRedirectValue instanceof UrlValue && !$content->getField('external_redirect')->isEmpty()) {
            if (mb_stripos($externalRedirectValue->link, 'http') === 0) {
                return new RedirectResponse($externalRedirectValue->link, RedirectResponse::HTTP_MOVED_PERMANENTLY);
            }

            return new RedirectResponse(
                $this->router->generate($this->getRootLocation()) . trim($externalRedirectValue->link, '/'),
                RedirectResponse::HTTP_MOVED_PERMANENTLY
            );
        }

        return null;
    }
1092638
public function redirect($dest, $code = 302)
    {
        if (!in_array($code, self::$redirect_codes)) {
            trigger_error("Invalid HTTP redirect code {$code}", E_USER_WARNING);
            $code = 302;
        }
        $this->setStatusCode($code);
        $this->addHeader('location', $dest);
        return $this;
    }
892615
public static function to(?string $path = '/', ?int $code = null)
  {
    $redirect = new Redirect;
    $redirect->url = $path;

    if ($code !== null) {
      $redirect->code = $code;
      return $redirect->send();
    }

    return $redirect;
  }
89784
protected function redirect($location, $status = 302, $headers = array()) {
		// Check if a output action has be already performed
		$this->_checkIfPerformed();

		// Create a redirect
		$redirectResponse = \Symfony\Component\HttpFoundation\RedirectResponse::create($location, $status, $headers);

		// Add request informationen
		$redirectResponse->prepare($this->application->requestStack->getCurrentRequest());

		// Replace response object
		$this->application->response = $redirectResponse;

		// Don't use a template
		$this->useTemplate(false, $status);
	}
1183548
public function redirect($uri, int $code = 302): ResponseInterface
    {
        if (!is_string($uri) && !$uri instanceof UriInterface) {
            throw new ResponseException("Redirect allowed only for string or UriInterface uris");
        }

        return $this->responseFactory->createResponse($code)->withHeader("Location", (string)$uri);
    }
874322
public function redirect($url, $statusCode = 302)
    {
        $context = Context::getInstance();

        header(HTTPToolkit::statusCodeHeader($statusCode));
        header(HTTPToolkit::locationHeader($url));

        throw new InterruptedActionException(
            'Interrupted action after a redirection',
            $context->getModuleName(),
            $context->getActionName()
        );
    }
851915
public function close($fd, $code = self::CLOSE_NORMAL, $reason = '')
    {
        $this->send($fd, pack('n', $code).$reason, self::OPCODE_CONNECTION_CLOSE);
        $this->log("server close connection[$fd]. reason: $reason, close_code = $code");
        return $this->server->close($fd);
    }
1029592
public function redirectTo( $url = 0, $code = 302 ) {
		if ( $url === null ) {
			$this->redirectTo = null;
			return true;
		}
		if ( !is_string( $url ) || !is_int( $code ) ) {
			return false;
		}
		$this->redirectTo = [ $url, $code ];
		return true;
	}
799823
public function redirect($url)
    {
        $this->checkIfHeadersAlreadySent();
        $url = $this->di->get("url")->create($url);
        header('Location: ' . $url);
        exit();
    }
1039560
public function redirect(string $location, int $code = Status::FOUND): self
    {
        $this->setStatus($code)->setHeader('Location', trim($location));

        return $this;
    }
957025
public function removeLocation(string $location)
    {
        $key = array_search($location, $this->paths);
        
        if ($key) {
            unset($this->paths[$key]);
        }
    }
219519
public static function redirect($location, $permanent = false)
    {
        $redirect = new static($permanent ? 301 : 302);
        $redirect->setHeader('Location', $location);

        return $redirect;
    }
1213990
public function setLocation(string $location)
    {
        if (empty($location)) {
            Throw new HeaderException('Empty location is now allowed.');
        }

        $this->location = $location;
    }
1258994
public static function location($response, $url, $code = 302) {
        $response->status($code);
        $response->header('Location', $url);
        $response->end();
    }