public function setRedirect($hostname)
    {
        if (!empty($hostname))
        {
            $this->redirect = new URL($hostname); 
            $this->redirect->set('path', rtrim($this->redirect->path, '/'));
        }
        else
            $this->redirect = false;
        return $this;
    }