src/Exception/RedirectException.php
public function location($uri = null)
    {
        if (null === $uri)
        {
            return $this->headers('Location');
        }

        if (false === strpos($uri, '://'))
        {
            $uri = Url::site($uri, true, ! empty(Base::$indexFile));
        }

        $lastTime = gmdate("D, d M Y H:i:s", time()).' GMT+0800';
        $this->headers('Cache-Control', 'no-cache');
        $this->headers('Last Modified', $lastTime);
        $this->headers('Last Fetched', $lastTime);
        $this->headers('Expires', 'Thu Jan 01 1970 08:00:00 GMT+0800');
        $this->headers('Location', $uri);

        return $this;
    }
public function location($uri = null)
    {
        if (null === $uri)
        {
            return $this->headers('Location');
        }

        if (false === strpos($uri, '://'))
        {
            $uri = Url::site($uri, true, ! empty(Base::$indexFile));
        }

        $lastTime = gmdate("D, d M Y H:i:s", time()).' GMT+0800';
        $this->headers('Cache-Control', 'no-cache');
        $this->headers('Last Modified', $lastTime);
        $this->headers('Last Fetched', $lastTime);
        $this->headers('Expires', 'Thu Jan 01 1970 08:00:00 GMT+0800');
        $this->headers('Location', $uri);

        return $this;
    }
跳转到指定URI

@param  string $uri
@return $this