public function redirectTo($target, $headerCode = 301, $withOrigin = false)
    {
        if (!($this->request instanceof WebRequest)) {
            return;
        }
        
        if (!preg_match('/http(s?)\:\/\//', $target)) {
            $target = $this->request->getFullRoute($target);
        }
        
        if ($withOrigin) {
            $target = $this->addOriginToTargetUrl($target);
        }
        
        header("Location: " . $target, true, $headerCode);
    }