Redirect client the the given link under the same domain.

@param string $path
@param string|null $assetSite

@return Redirect
@deprecated use asset() method instead of this mthod
496051
public static function link(string $path, string $assetSite = null): Redirect
    {
        return self::temporary(Application::route()->asset($path, $assetSite));
    }
506125
@Override
    public Asset<?> assetAt(String path) {
        Asset<?> asset = getAssetFromFS(path);
        if (asset == null) {
            asset = getAssetFromBundle(path);
        }
        return asset;
    }
445665
public function redirect($path, $type = 302, $end = true)
    {
        // $type should be one of the following:
        // 301 = Moved permanently
        // 302 = Temporary redirect
        // 303 = Perform GET at new location (instead of POST)

        if (headers_sent()) {
            if (self::$exceptOnHeaders) {
                throw new \Exception('Headers already sent. Redirect cannot be initiated.');
            } else {
                return;
            }
        }

        if (self::$outputBuffering) {
            $this->cleanBuffer();
        }

        $this->code($type);
        header('Location: '. $path);

        if ($end) {
            exit;
        }
    }
745676
public function downloadAssetFile(AssetFile $assetFile, Locator $locator, $path)
    {
        Validate::isString($path, 'path');
        Validate::pathExists($path);

        $downloadUrl = $locator->getBaseUri().'/'.$assetFile->getName().$locator->getContentAccessComponent();
        $filePath = $path.'/'.$assetFile->getName();

        return file_put_contents($filePath, fopen($downloadUrl, 'r'));
    }
785981
public function publishAssets($path, $forceCopy = false)
    {
        if (!Yii::app()->hasComponent('assetManager')) {
            throw new CException('Failed to locate the asset manager component.');
        }
        /* @var CAssetManager $assetManager */
        $assetManager = Yii::app()->getComponent('assetManager');
        $assetsUrl = $assetManager->publish($path, false, -1, $forceCopy);
        return $this->_assetsUrl = $assetsUrl;
    }
542873
static function RedirectRelative($target, $noExit = false)
    {
        session_write_close();
        $dirName =  dirname($_SERVER["PHP_SELF"]);
        if ($dirName == "/")
            $dirName = "";
        header("Location: " .  "http://" . $_SERVER["HTTP_HOST"]
            . $dirName
            . "/" .  $target);
        if (!$noExit)
        {
            exit();
        }
    }
500963
public function withPath($path): UriInterface
   {
       if (!is_string($path)
        || !($parsedPath = $this->parsePath($path))) {
           throw new InvalidArgumentException(
               "Can't get with path: invalid expression");
       }
       return $this->with("path", $parsedPath);
   }
1125407
protected function _relative_path_to_url( $path, $content ) {
		if ( wp_http_validate_url( $path ) ) {
			return $path;
		}

		$permalink = $this->get_permalink();
		if ( ! $permalink ) {
			$permalink = $this->_get_permalink( $content );
		}

		preg_match( '/(https?:\/\/[^\/]+)/', $permalink, $reg );
		if ( empty( $reg[0] ) ) {
			return false;
		}

		return trailingslashit( $reg[0] ) . $path;
	}
750176
public function asset($path, $secure = null)
    {
        if ($this->isValidUrl($path)) {
            return $path;
        }

        // Once we get the root URL, we will check to see if it contains an index.php
        // file in the paths. If it does, we will remove it since it is not needed
        // for asset paths, but only for routes to endpoints in the application.
        $root = $this->newGetRootUrl($this->getScheme($secure));

        return $this->removeIndex($root).'/'.trim($path, '/');
    }
1136900
protected function redirect($path)
	{
		$path = str_replace('//', '/', $this->app->baseURL . $path);

		$this->app->redirect($path);
	}
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;
    }
700490
public function asset_url($path)
    {
        // iframe content can't be in a different domain
        // @TODO: check if assests are on a different domain

        if (!$this->assets_path || in_array($path[0], array('?', '/', '.')) || strpos($path, '://')) {
            return $path;
        }

        return $this->assets_path . $path;
    }
740677
public function find(string $path): AssetFileInterface
    {
        if ($this->isExternal($path)) {
            return (new File($this->files))
                ->setPath('')
                ->setUrl($path)
                ->setExternal(true)
                ->setType($path);
        }

        $path = trim($path, '\/');

        foreach ($this->locations as $dir => $url) {
            if ($this->files->exists($fullPath = $dir.'/'.$path)) {
                return (new File($this->files))
                    ->setPath($fullPath)
                    ->setUrl($url.'/'.$path)
                    ->setExternal(false)
                    ->setType($fullPath);
            }
        }

        throw new AssetException('Unable to find the asset with the following path: '.$path);
    }
1063089
public function redirectGuest($path, $status = 302, $headers = array(), $secure = null)
	{
		return $this->redirector->guest($path, $status, $headers, $secure);
	}
304227
public function redirectToPath($path, $parameters = array())
    {
        $route = $this->getRouter()->generate($path, $parameters);

        return $this->redirect($route);
    }
344830
public static function to($url = '', $https = null, $asset = false)
    {
        $url = trim($url, '/');

        if (static::valid($url)) {
            return $url;
        }

        $root = self::format($https, $asset);

        return rtrim($root, '/') . '/' . ltrim($url, '/');
    }
907199
public void redirect(String path) throws IOException
    {
        //response.setHeader("Location", path.charAt(0)=='/' ? path : "/"+path);
        response.sendRedirect(path.charAt(0)=='/' ? path : "/"+path);
        output.close();
    }