public function redirect($url, $code = 301)
    {
        $this->setStatusCode($code);
        $this->addHeader(HttpProtocol::HEADER_LOCATION, $url);
    }
public function redirect($url, $code = 301)
    {
        $this->setStatusCode($code);
        $this->addHeader(HttpProtocol::HEADER_LOCATION, $url);
    }
public function redirect ( $ url , $ code = 301 ) { $ this -> setStatusCode ( $ code ) ; $ this -> addHeader ( HttpProtocol :: HEADER_LOCATION , $ url ) ; }
Redirects to the passed URL by adding a 'Location' header and
setting the appropriate status code, by default 301.

@param string  $url  The URL to forward to
@param integer $code The status code to set

@return void
Redirects to the passed URL by adding a Location header and setting the appropriate status code by default 301 .