protected function initHeaders() { $newUrl = $this->getNewUrl(); if (empty($newUrl) || $this->httpRequest->getUri() == $newUrl) { // Set infinity loop (508) $this->responseCode = 508; return; } $this->responseCode = 301; $this->headers['Location'] = $newUrl; }