/ Published in: PHP
TYPO3 pageNotFoundHandling with determination of 404 and 401/403 stats.
Modify LOGIN_URL and NOTFOUND_URL !
Save as pageNotFoundHandling.php and point to this from Install Tool setting.
[FE][pageNotFound_handling] = USER_FUNCTION:fileadmin/scripts/pageNotFoundHandling.php:user_pageNotFound->pageNotFound
Enable cURL by setting [SYS][curlUse] = 1 at Install Tool
cURL must provide from system !
To get redirected after login to the request page, you have to use 'defined by GET/POST-Vars' at felogin redirect mode
Expand |
Embed | Plain Text
<?php class user_pageNotFound { function pageNotFound($param, $ref) { $url = LOGIN_URL."?redirect_url=" . $param["currentUrl"]; } else { $url = NOTFOUND_URL; } $strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/'; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_COOKIE, $strCookie); $contents = curl_exec($c); curl_close($c); if ($contents) return $contents; else return FALSE; } } ?>
You need to login to post a comment.
