Forum Moderators: open

Message Too Old, No Replies

Clean up with custom 404s

         

mikemcs

7:23 pm on Apr 16, 2003 (gmt 0)

10+ Year Member



Frshbot keeps hitting some pages that I use to have written in php but have moved. The problem is that the only thing different in the URL is the query part. For example I use to have mysite.com?detail=page1 but that page now lives at mysite.com?detail=BlueWidget. So I want to tell freshbot that the query Detail=Page1 is no longer valid. How can I show the 404 error and is that the correct error to show? I know I can just use a if statement and if true then print header('Location: HTTP/1.0 404'); but does this really tell google that this page is not valid anymore?

Thanks, Mike

sullen

7:55 pm on Apr 16, 2003 (gmt 0)

10+ Year Member



best to use a 301 (Page permanently moved) error rather than a 404. Absolutely no idea of how to do this in PHP though (but yes, use an if statement).

mikemcs

8:04 pm on Apr 16, 2003 (gmt 0)

10+ Year Member



The 301 is a redirect while I agree for my example above it would work. What I really want is a way to get Google to drop the URL totally. The second part of my question is if I redirect to a 404.php file would freshbot / deepbot see the 404.php file as the 404 and not the page it is trying to index?

btw here is what I use for 301's

<?php
// redirect
if ($SERVER_NAME == "www.mysite.com")
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: [mynewsite.com");...]
exit();
}
?>

My question even in this case does Google really see the page it is trying to index has moved or does it just get redirected to the good page?

jdMorgan

8:08 pm on Apr 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Mike,

I'd suggest returning a 410-Gone status, rather than 404-Not Found or 301-Moved Permanently.

Jim

mcavic

8:16 pm on Apr 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



does Google really see the page it is trying to index has moved or does it just get redirected to the good page?

In my experience Freshbot will ignore the 301 and not even retrieve the new page. But Deepbot will drop the old page and replace it with the new url.

Just make sure it's a 301, not a 302. With a 302, I think it'll just get the new content and not replace the url.

mcavic

8:23 pm on Apr 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



410-Gone? Never heard of it, but I just looked it up. It sounds utterly silly to me.

The requested resource is no longer available at the server and no forwarding address is known. This condition SHOULD be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) SHOULD be used instead. This response is cachable unless indicated otherwise.

The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer working at the server's site. It is not necessary to mark all permanently unavailable resources as "gone" or to keep the mark for any length of time -- that is left to the discretion of the server owner.