Redirect Response.

@param string $url
@param int    $status
@param array  $headers
769405
public static function redirect($url, $status = 302, $headers = array())
    {
        $redirect = new RedirectResponse($url, $status, $headers);
        $redirect->sendHeaders();
        die();
    }
775258
public function redirect($location, $status = 302)
    {
        if (!$location) {
            return;
        }
        $this->status($status);
        $headers = $this->headers();
        $headers['Location'] = $location;
        return $this;
    }
191708
protected function createRedirect($path, $status, $headers)
    {
        $response = new RedirectResponse($path, $status, $headers);

        // Session
        if (isset($this->session)) {
            $response->setSession($this->session);
        }

        // Request
        $response->setRequest($this->generator->getRequest());

        return $response;
    }
581920
public function redirectGuest($path, $status = 302, $headers = [], $secure = null)
    {
        return Redirect::guest($this->uri() . '/' . $path, $status, $headers, $secure);
    }
429739
public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
    {
        return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
    }
1305706
public function sendRedirect($location, $status = 302)
    {
        if (!is_int($status) || $status < 300 || $status > 399) {
            return;
        }
        
        if ($location[0] != '/' && !preg_match("/^[0-9a-z]+:\\/\\//i", $location)) {
            $location = $this->baseUrl . $location;
        }
        
        $this->clearHeaders();
        $this->addHeader('Location', $location, true);
        $this->setStatus($status);
        $this->isRedirect = true;
        $this->sendHeaders();
        
        exit();
    }
289057
public function redirect($path, $status = 302, $headers = [], $secure = null)
    {
        return Redirect::to($this->uri() . '/' . $path, $status, $headers, $secure);
    }
920001
protected function redirect($url = null, $queryParams = [], $statusCode = 302) {

		if(is_null($url)) {
			return $this->route->redirect($queryParams, $statusCode);
		}

		if($queryParams) {
			$query = (strpos($url, '?') === false ? '?' : '&') . http_build_query($queryParams);
		}

		else {
			$query = '';
		}

		return new RedirectResponse($url . $query, $statusCode);

	}
520818
protected function responseRedirect($url, $status = null)
    {
        $responseWithRedirect = $this->_response->withHeader('Location', (string)$url);
        if (is_null($status) && $this->_response->getStatusCode() === 200) {
            $status = 302;
        }
        if (!is_null($status)) {
            return $responseWithRedirect->withStatus($status);
        }
        return $responseWithRedirect;
    }
1328859
public static function redirect($url, array $parameters = [], int $statusCode = Response::STATUS_MOVED_PERMANENTLY) : Response
    {
        if (!empty($parameters)) {
            $url = $url . '?' . http_build_query($parameters);
        }

        $headers = new Headers();
        $headers->add(new Header('Location', $url));

        return new Response('', $statusCode, $headers);
    }
369201
protected function redirect(string $url, array $parameters = [], int $httpResponseCode = 307)
    {
        $query = '';
        // Making URL query string if parameters given.
        if (!empty($parameters)) {
            $query = '?';
            if (parse_url($url, PHP_URL_QUERY)) {
                $query = '&';
            }
            $query .= http_build_query($parameters);
        }

        header('Location: ' . $url . $query, true, $httpResponseCode);
        exit;
    }
273270
public function redirectToRoute($route, $parameters = [], $status = 302, $headers = [])
    {
        respondWith(response()->redirectToRoute($route, $parameters, $status, $headers));
    }
970643
public function back($status = 302, $headers = [], $fallback = false)
    {
        return $this->createRedirect($this->generator->previous($fallback), $status, $headers);
    }
301625
public static function redirect(string $url, $httpResponseCodeParam = null)
    {
        if ($httpResponseCodeParam) {
            if (array_key_exists($httpResponseCodeParam, self::STATUS_CODE)) {
                $httpResponseCode = $httpResponseCodeParam;

                header('Location: '.$url, true, $httpResponseCode);
            } else {
                getException('Status code "'.$httpResponseCodeParam.'" not good.');
                
                header('Location: '.$url);
            }
        } else {
            header('Location: '.$url);
        }
        
        exit();
    }
206656
public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array())
	{
		return $this->redirector->action($action, $parameters, $status, $headers);
	}
1111227
public function redirect($url, $parameters = [], $status = 302)
    {
        if (substr($url, 0, 1) == '@') {
            $route = substr($url, 1);
            $url = $this->generateUrl($route, $parameters);
        }
        return new RedirectResponse($url, $status);
    }
581281
protected function createRedirect($path, $status, $headers)
	{

		if (isset($this->session))
		{
			// save to keep data because it will be flushed by the redirect
			$this->session->save('redirection');
		}

		wp_redirect($path, $status);
		exit;
	}