data(); // Redirect if we can if (!$this->getResponse()->isFinished() && $link = $page->redirectionLink()) { return $this->redirect($link, 301); } // Respond with 404 if redirecting to a missing file or page if (($this->RedirectionType === 'Internal' && !$page->LinkTo()?->exists()) || ($this->RedirectionType === 'File' && !$page->LinkToFile()?->exists()) ) { if (static::config()->get('missing_redirect_is_404')) { $this->httpError(404); } } // Fall back to a message about the bad setup return parent::handleAction($request, 'handleIndex'); } /** * If we ever get this far, it means that the redirection failed. */ public function getContent() { return "

" . _t(__CLASS__ . '.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') . "

"; } }