Hallo,
hier ist ein etwas modifiziertes Script, das einige Fehler, die bisher aufgetaucht sind abfangen sollte. Für bestimmte Domains ist der Text auf Englisch. Etwas Ähnliches ließe sich sicherlich auch mit "Sprachunterverzeichnissen" erreichen. Auf den von Typo3 angeboteten Fehlertext ($param['reasonText']) wird verzichtet. 😉
<?php
class user_pageNotFound {
function pageNotFound($param,$ref) {
header('HTTP/1.0 404 Not Found');
$host = '';
if(!empty($_SERVER['HTTP_X_FORWARDED_HOST'])){
$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
}
else if(!empty($_SERVER['HTTP_HOST'])){
$host = $_SERVER['HTTP_HOST'];
}
if (!empty($host)){
$page = $GLOBALS['_ENV']['REQUEST_URI'];
$english = array('www.gmo-free-regions.org','www.genet-info.org','www.saveourseeds.org');
if (in_array($host,$english)) {
$msg = '
<h3>Sorry, the page <em> '. $page .' </em> you requested could not be found.</h3>
<p class="top_1"><a href="./">» Here you can go to the home page of '. $host .' </a></p>
';
} else {
$msg = '
<h3>Die aufgerufene Seite <em> '. $page .' </em> kann nicht gefunden werden.</h3>
<p class="top_1"><a href="./">» Hier geht es zur Startseite von '. $host .'</a></p>
';
}
$filename = "http://$host/error.html" ;
$handle = fopen($filename, "r");
if ($handle) {
$filecontent = '';
while (!feof($handle)) {
$filecontent .= fgets($handle, 4096);
}
fclose($handle);
$pagenotfound = str_replace('{msg}', $msg, $filecontent);
echo $pagenotfound;
} //if ($handle)
else echo '<h2>SCRIPT-ERROR: Error-File '.$filename.' cannot be found.</h2>';
} // if (!empty($host))
else echo '<h2>SCRIPT-ERROR: No variable for the host (e.g. www.test.com) could be found.</h2>';
} // function
} // class
?>
Vielleicht hilft das ja schon mal weiter?