public function httpRedirect($url)
{
$this->ensureHeadersSent();
if ($url[0] === '/') {
$url = $this->getRequest()->getBaseUrl() . $url;
}
if ($this->_status >= 300 && $this->_status < 400) {
// The status code has been modified to a valid redirection status, send it
header('Location: ' . str_replace('&', '&', $url), true, $this->_status);
} else {
header('Location: ' . str_replace('&', '&', $url));
}
if (!$this->getApplication()->getRequestCompleted()) {
$this->getApplication()->onEndRequest();
}
exit;
}