Created
August 24, 2015 17:48
-
-
Save Da-Fecto/bdb42507536011cf5294 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stolen code, thanks Soma ! | |
public function init() { | |
$this->addHookAfter("ProcessPageView::pageNotFound", $this, "hook404Page"); | |
} | |
public function hook404Page($event){ | |
header("HTTP/1.1 404 Page Not Found"); | |
$page = wire("pages")->get("/404/"); // get your 404 page | |
$this->wire('page', $page); | |
$event->return = $page->render(); // render and return that page | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment