Created
July 10, 2020 07:21
-
-
Save ogrosko/581202ad1ec6cb86099ddcc0933bdb92 to your computer and use it in GitHub Desktop.
Redirect to 404 from extbase action
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
# https://stackoverflow.com/questions/55007086/how-to-return-a-proper-404-error-from-extbase-with-a-error-handling-configuratio | |
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction( | |
$GLOBALS['TYPO3_REQUEST'], | |
'Your error message', | |
['code' => PageAccessFailureReasons::PAGE_NOT_FOUND] | |
); | |
throw new ImmediateResponseException($response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment