[thelist] Custom Error404 redirect

Afonso Fernandez Nogueira fonso at aturuxo.net
Tue Jun 18 11:14:01 CDT 2002


> Is using a custom Error 404 page to make cleaner URLs a good or bad idea?
>
> Currently Ive set up my page so that index.html is the error 404 document and it has a piece
> of PHP which parses the REQUEST_URI variable and works out what content is needed
> in the page from that...
>
> it works like a dream but Im just concerned that this is a bad way of doing things in terms
> of offending googlebot and others. Will he spider the site or will he just think its always returning
> an Error 404 each time a page is requested?

As long as your server response header reports the 404 (check you access.log), there should be no problem. Supposing you are using the Apache directive ErrorDocument 404 <uri>, the server does the right thing.

And, if that piece of php in your index.html doesn't find a valid request in the REQUEST_URI, you should always send in the proper header before any other content is echoed. So for a 404:

<?php header("HTTP/1.1 404 Not Found"); ?>

Ok, maybe you already were aware of this :)

Cheers,
fonso




More information about the thelist mailing list