Commit 015514da authored by Kevin Ditscheid's avatar Kevin Ditscheid

[FEATURE] Detect htaccess conflicts in pageNotFoundHandling

If the page for PageNotFoundHandling is having htaccess protection,
there will be a runtime error, if TYPO3 tries to access it. We want
to make this error a little clearer in the output message, so the
developer knows where to search.
parent a7f241d7
......@@ -342,9 +342,17 @@ class RoutingService {
// this can happen if e.g. the wanted error page can't be fetched.
$htaccessMessage = '';
$exception->getPrevious() instanceof \RuntimeException &&
\strpos($exception->getPrevious()->getMessage(), '401 Unauthorized')!==FALSE
) {
$htaccessMessage = ' The error page reported 401 Unauthorized, maybe there is a htaccess protection on it.';
echo GeneralUtility::makeInstance(ErrorPageController::class)->errorAction(
'Page Not Found',
'Reason: ' . $exception->getMessage()
'Reason: ' . $exception->getMessage() . $htaccessMessage
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment