Skip to content

Commit 891f3f6

Browse files
Darren-Lee JosephDarren-Lee Joseph
Darren-Lee Joseph
authored and
Darren-Lee Joseph
committed
This fixes #13. Now shows UtilityPage even on 404
1 parent 641a2f1 commit 891f3f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

code/MaintenanceModeExtension.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ public function onBeforeInit() {
4646
if (!$utilityPage->config()->DisableRedirect) {
4747
//If this is not the utility page, do a temporary (302) redirect to it
4848
if($this->owner->dataRecord->ClassName != "UtilityPage") {
49-
return $this->owner->redirect($utilityPage->AbsoluteLink(), 302);
49+
$response = new SS_HTTPResponse();
50+
$response->redirect($utilityPage->AbsoluteLink(), 302);
51+
HTTP::add_cache_headers($response);
52+
$response->output();
53+
die();
5054
}
5155
}
5256

0 commit comments

Comments
 (0)