Zur Erstellung einer sauber funktionierenden 404-Fehler-Weiterlterleitung geht man wie folgt vor:
In die localconf.php Datei diese Zeile schreiben:
1 |
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] = 'USER_FUNCTION:fileadmin/scripts/pageNotFoundHandling.php:user_pageNotFound->pageNotFound'; |
Diese Datei erzeugen in „fileadmin/scripts/pageNotFoundHandling.php“:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<?php class user_pageNotFound { function pageNotFound($param,$ref) { echo '<html><head><title>404 Not found</title>'; echo '<meta http-equiv="refresh" CONTENT="0;URL=/seite-nicht-gefunden/">'; echo '</head><body>'; echo '<!-- Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page Just a placeholder to reach the limit of a custom 404 page -->'; echo '</body></html>'; } } ?> |