src/HTTP2.php
function redirect($url, $exit = true, $rfc2616 = false)
    {
        if (headers_sent()) {
            return false;
        }

        $url = $this->absoluteURI($url);
        header('Location: '. $url);

        if ($rfc2616 && isset($_SERVER['REQUEST_METHOD'])
            && $_SERVER['REQUEST_METHOD'] != 'HEAD'
        ) {
            echo '
<p>Redirecting to: <a href="'.str_replace('"', '%22', $url).'">'
                 .htmlspecialchars($url).'</a>.</p>
<script type="text/javascript">
//<![CDATA[
if (location.replace == null) {
    location.replace = location.assign;
}
location.replace("'.str_replace('"', '\\"', $url).'");
// ]]>
</script>';
        }
        if ($exit) {
            exit;
        }
        return true;
    }
function redirect($url, $exit = true, $rfc2616 = false)
    {
        if (headers_sent()) {
            return false;
        }

        $url = $this->absoluteURI($url);
        header('Location: '. $url);

        if ($rfc2616 && isset($_SERVER['REQUEST_METHOD'])
            && $_SERVER['REQUEST_METHOD'] != 'HEAD'
        ) {
            echo '
<p>Redirecting to: <a href="'.str_replace('"', '%22', $url).'">'
                 .htmlspecialchars($url).'</a>.</p>
<script type="text/javascript">
//<![CDATA[
if (location.replace == null) {
    location.replace = location.assign;
}
location.replace("'.str_replace('"', '\\"', $url).'");
// ]]>
</script>';
        }
        if ($exit) {
            exit;
        }
        return true;
    }
This function redirects the client. This is done by issuing
a "Location" header and exiting if wanted.  If you set $rfc2616 to true
HTTP will output a hypertext note with the location of the redirect.

@param string $url     URL where the redirect should go to.
@param bool   $exit    Whether to exit immediately after redirection.
@param bool   $rfc2616 Wheter to output a hypertext note where we're
redirecting to (Redirecting to
<a href="...">...</a>.)

@return boolean Returns TRUE on succes (or exits) or FALSE if headers
have already been sent.