[TYPO3] pageNotFound_handling - 404 error

Ries van Twisk typo3 at rvt.dds.nl
Wed Feb 1 14:46:49 CET 2006

For page not found handeling, in combination with realUrl I wrote my own

By default it works, but I needed to redirect to a search page and that
was when realUrl/typo3 stopped sending my browser 404  messages.

this is what I did:
I added this to my localconf.php
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] =

The pagenotfound.php file looks like this:

class    user_pagenotfound {
    function pagenotfound($param, $conf) {
    $toReplace = array('_', '-', '/');
    $url = trim(str_replace($toReplace,' ',$param['currentUrl'] ));
    $url = "search/$url/";
    header("HTTP/1.0 404 Not Found");
    print '<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="#internalStyle" type="text/css"?>

function doRedirect() {

setTimeout("doRedirect()", 1000);
// -->

<body style="font-family: Verdana, Geneva, Arial, Helvetica,
<p style="font-size:40px;text-align:center">Page not found!</p>
<p>If you are not automaticly redirected in 3 seconds please click here:
<br />
<br /><a


I made the php file tailer made for my site, on the search page I use
realURL that can grab the parameters and does a search directly.
You might want to do something else!!!!!

Try this on my site:

With live headers enabled, you will see the 404 directly after the get
request then you get redirected to my search page and a search for quito
is performed.
The redirect is done with javascript and not with a Location header,
why??? It simply didn't work adding both headers.
Also this will let you make a nice next + image or anything else you
would like yout users to tell (you already told the spider about the 404)

Let me know if this works for you aswell...

This solution also might work for the guy that has 404 problems with a
multiple domain setup...


>Christine Rochelt wrote:
>>Thanks, but no actually I do not use simulateStatic. Any other
>Than just use mod_rewrite. I am not a guru in it but there are
>directives to test if file/directory exists or not and redirect
>appropriately. See in example .htaccess, which is supplied with typo3.
>Personally I would rather use realurl and old recreate site structure in
>typo3. This will make all old links to the site valid. Also Google will
>be happy, your site will not drop ratings.
>TYPO3-english mailing list
>TYPO3-english at lists.netfielders.de

More information about the TYPO3-english mailing list