Redirect HTTP on the URL param. Relative path as default. Queued messages
get a persistent storage in a cookie in order to being retrieved later.

@param	string	Location URL.
@param	bool	If TRUE, will avoids to add base url (default FALSE).
559379
public function redirect($url, $externalUrl=FALSE) {
	
		// stores enqueued messages for next retrievement
		$this->makeQueuedMessagesPersistent();
		
		if (!$url) return;
		
		// external redirect
		if ($externalUrl) {
			
			header('Location: ' . $url);
			
		// redirect to internal path
		} else {
			
			$router = Router::getInstance();
			$page  = $router->getPage();
			
			if ($page > 1) {
				
				// removes a possible leading slash
				if ('/'==$url{0}) {
					$url = substr($url,1);
				}
				
				// if url contains just module, create a fake action placeholder
				if (FALSE == strpos($url, '/')) {
					$url .= '/';
				}
				
				header('Location: ' . BASE_HREF . $url . '/page-' . $page);
				
			} else {
				
				header('Location: ' . BASE_HREF . $url);
				
			}
				
		}
	
		exit();

	}
1057383
function (urlpath, log) {
    casper.then(function () {
        if (log !== false) {
            this.echo('#green{redirect:} #yellow{[' + urlpath + ']}');
        }
        casper.evaluate(function (url) {
            window.location.href = url;
        }, urlpath);
    });
}
55035
public static void redirect(HttpServletResponse response, String url,
                                boolean movePermanently) throws IOException {
        if (!movePermanently) {
            response.sendRedirect(url);
        } else {
            response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
            response.setHeader("Location", url);
        }
    }
1345893
public static function redirect($location, $permanent = false)
    {
        $response = new self(
            $permanent ? Status::MOVED_PERMANENTLY : Status::SEE_OTHER,
            new StringStream('')
        );
        $response->setHeader('Location', $location);
        return $response;
    }
150867
public static function doRedirect($location) {
        if ( headers_sent() ) {
            // TODO: Check if this is fixed in PHP 70200
            // https://bugs.php.net/bug.php?id=74892
            if ( PHP_VERSION_ID >= 70000 ) {
                $location = U::addSession($location);
            }
            echo('<a href="'.$location.'">Continue</a>'."\n");
        } else {
            if ( ini_get('session.use_cookies') == 0 ) {
                $location = U::addSession($location);
            }
            header("Location: $location");
        }
    }
253358
def respond_redirect(self, location='/'):
		
		self.send_response(301)
		self.send_header('Content-Length', 0)
		self.send_header('Location', location)
		self.end_headers()
		return
1072447
public static function httpRedirect($url, $code=NULL)
    {
        if ($code == 301) {
            header('HTTP/1.1 301 Moved Permanently');
        } else {
            header('HTTP/1.1 302 Moved Temporarily');
        }
        header('Location: ' . $url);
        die();
    }
812760
public function redirect($url='') {
		if(!preg_match('/^(?:\/|\\\\|\w:\\\\|\w:\/).*$/', $url) && !preg_match('/^[a-zA-Z0-9]*:\/\//', $url))#relative
			$url = $this->request->url->to($url);
		$this->setHeader('Location', $url);
		if($this->code === 200)
			$this->setCode(302);
		return $this;
	}
1176432
def redirect(url, status: (env['HTTP_VERSION'] == 'HTTP/1.1') ? 303 : 302, halt: true)
      response['Location'] = absolute(url)
      response.status = status
      self.halt if halt
    end
1336629
final protected function getRedirectResponse($location, $addSuffix = true)
    {
        $url = $this->request()->getAppUrl();
        $url .= $location;
        if ($addSuffix) {
            $url .= $this->request()->getSuffix();
        }
        return $this->getRedirectUrlResponse($url);
    }
729829
public function redirect($url, $useUrl = true, $httpCode = 302)
    {
        Atomik::fireEvent('Atomik::Redirect', array(&$url, &$useUrl, &$httpCode));
        if ($url === false) {
            return;
        }
        
        if ($useUrl) {
            $url = Atomik::url($url);
        }
        
        if (isset($_SESSION)) {
            $session = $_SESSION;
            // seems to prevent a php bug with session before redirections
            session_regenerate_id(true);
            $_SESSION = $session;
            // avoid loosing the session
            session_write_close();
        }
        
        header('Location: ' . $url, true, $httpCode);
        Atomik::end(true, false);
    }
826574
public function isRedirect($location = null)
    {
        return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->getHeaderLine('Location'));
    }
839748
public static function redirect($url = false){
		
		if($url) {

			if(strpos($url,'http') === false && strpos($url,'https') === false) {
				$url = BASE_URL . $url;
			}

			header('Location: ' . $url);
			exit;
		}

		return false;
	}
76542
public function isRedirect($location = NULL) {

		return in_array(
				$this->statusCode,
				[
					self::HTTP_CREATED,
					self::HTTP_MOVED_PERMANENTLY,
					self::HTTP_FOUND,
					self::HTTP_SEE_OTHER,
					self::HTTP_TEMPORARY_REDIRECT,
					self::HTTP_PERMANENTLY_REDIRECT
				]
		) && (NULL === $location ?: $location == $this->headers->get('Location'));

	}
117954
public function isRedirect(string $location = null): bool
    {
        return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location'));
    }
1263372
public function redirect($url)
    {
        if (!$this->isValidUrl($url)) {
            $url = $this->generateUrl($url);
        }

        header('Location: '.$url);
    }
108929
public static function redirect($url,$isHttps=false){
		if($url){
			if(substr($url,0,4) != "http"){
				$url = self::getUrl($url,[],$isHttps);	
			}
			header("Location: $url");
			exit;
		}
	}