Resolve the url redirection.

@param Url $url

@return Url
19714
public static function resolve(Url $url)
    {
        foreach (self::$patterns as $method => $pattern) {
            if ($url->match($pattern)) {
                return self::$method($url);
            }
        }

        return $url;
    }
250569
protected static function resolveUrl($url)
    {
        $url = trim($url);
        if (strlen($url)) {
            if (preg_match('%^https?\:\/\/%', $url)) {
                return $url;
            }
            $absScript = GeneralUtility::getFileAbsFileName($url);
            if (is_file($absScript)) {
                return substr($absScript, strlen(PATH_site));
            }
        }

        return null;
    }
1046192
public function redirect($url)
    {
        if (headers_sent()) {
            throw new RuntimeException('Unable to issue redirect header. Headers have already been sent.');
        }

        return $this->header(new Header(Header::LOCATION, $url));
    }
409080
public static function resolve_url($url)
    {
        // prepend protocol://hostname:port
        if (!preg_match('|^https?://|', $url)) {
            $schema       = 'http';
            $default_port = 80;

            if (self::https_check()) {
                $schema       = 'https';
                $default_port = 443;
            }

            $prefix = $schema . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']);
            if ($_SERVER['SERVER_PORT'] != $default_port) {
                $prefix .= ':' . $_SERVER['SERVER_PORT'];
            }

            $url = $prefix . ($url[0] == '/' ? '' : '/') . $url;
        }

        return $url;
    }
1024111
public static function setUrl($url) {

		if(false === is_string($url) && false === $url instanceof URLParser) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or instance of sFire\\Utils\\URLParser, "%s" given', __METHOD__, gettype($url)), E_USER_ERROR);
		}

		if(true === is_string($url)) {
			$url = new URLParser($url);
		}

		static :: $url = $url;
		return $url;
	}
456416
public function redirect($url, $autoRedirect = true)
    {
        if (!$this->config->getShopNumber()) {
            return '';
        }

        $url .= $this->processQueryString($url);

        if (
            !$this->isRedirectAllowed() || !$this->isMobileRequest() ||
            !$autoRedirect || (($this->redirectType == 'default') && !$this->enableDefaultRedirect)
        ) {
            return $this->getJsHeader($url);
        }

        // validate url
        if (!preg_match('#^(http|https)\://#', $url)) {
            return $this->getJsHeader();
        }

        // perform redirect
        header("Location: " . $url, true, 301);
        exit;
    }
1162095
protected function respond($url)
    {
        $response = $this->request($url);
        $response = $this->parse($response);

        return $this->create($response);
    }
894484
public static function getRelativeUrl($url = null) {
        $url = is_null($url) ? '/'.ltrim($_SERVER['REQUEST_URI'], '/') : $url;
        $rootUrlPath	= parse_url(ROOT_URL, PHP_URL_PATH);
        $absPath		= parse_url($url, PHP_URL_PATH);
        if (substr($absPath, 0, strlen($rootUrlPath)) != $rootUrlPath ) {
            throw new ResolverException('Request Uri '.$url.' outside of TAO path '.ROOT_URL);
        }
        if ($absPath === $rootUrlPath) {
            $result = '';
        } else {
            $result = substr($absPath, strlen($rootUrlPath));
        }
        return $result;
    }
1127440
public static function getPathFromURL($url)
	{
		$path = str_replace(self::getProtocolFromURL($url) . '://', '', $url);
		$path = str_replace(self::getDomainFromURL($url), '', $path);
		
		if($path == '') return '/';
		
		return $path;
	}
1298867
public function url($url = null)
    {
        if (!is_null($url) && true !== $url) {
            $this->url = $url;
            return $this;
        } elseif (!$this->url) {
            if ($this->isCli()) {
                $this->url = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
            } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
                $this->url = $_SERVER['HTTP_X_REWRITE_URL'];
            } elseif (isset($_SERVER['REQUEST_URI'])) {
                $this->url = $_SERVER['REQUEST_URI'];
            } elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
                $this->url = $_SERVER['ORIG_PATH_INFO'] . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
            } else {
                $this->url = '';
            }
        }
        return true === $url ? $this->domain() . $this->url : $this->url;
    }
80070
public function url($url = null)
    {
        if ($url === null) {
            return $this->_url;
        }
        $this->_url = $url;

        return $this;
    }
85076
public function setRedirect ($url)
	{
		$this->setHeader ('Location', $url);
		$this->setStatus (302);
		$this->setData (array ('message' => 'Redirecting to ' . $url));

		return $this;
	}
532585
public static function uploadsUrl($url = ''){
		$url = Config::get('congraph::congraph.uploads_url') . '/' . $url;
		$rtrim = !empty($url);
		$url = url(self::normalizeUrl($url, $rtrim));

		return $url;
	}
657645
public function setUrl($url)
    {
        // validate url
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            $this->url = $url;
        } else {
            throw new InvalidUrlException('"' . $url . '" is not a valid URL');
        }

        return $this;
    }
268876
public static function redirect($url = null)
    {
        if ($url === null or empty($url)) {
            $base_url = self::siteBaseUrl();
        } elseif ($url === 'self') {
            $base_url = self::siteUrl();
        } elseif ($url === 'prev') {
            $base_url = self::previous();
        } else {
            $base_url = $url;
        }
        ob_start();
        (new Redirect($base_url, 200));
    }
1142023
public function setRedirectUrl($redirectUrl)
    {
        if (!empty($redirectUrl) && ctype_print($redirectUrl)) {
            $this->redirectUrl = trim($redirectUrl);
        }

        return $this;
    }
786348
public function redirect($url = null)
    {
        if (null === $url) {
            $url = $this->getServer('HTTP_ORIGIN');
        }
        ob_start();
        header('Location: ' . $url);
        ob_end_clean();
        Security::getInstance()->updateSession();
        exit(t('Redireccionando...'));
    }