Forum Moderators: phranque

Message Too Old, No Replies

404 Error pages

Provide a 404 for google but redirect for yahoo

         

Shucar

7:43 pm on Sep 24, 2005 (gmt 0)

10+ Year Member



I need to provide Google with a standard 404 error page but want to provide yahoo and other SE's with our home page. Any ideas on how to accomplish this?

stapel

9:14 pm on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps by doing a ReDirect, in your .htaccess file, based on the Referer...?

WebMasterWorld: "Redirect certain referer in htaccess" [webmasterworld.com]

If I may ask: Why do you want to do this?

Eliz.

Shucar

11:36 pm on Sep 24, 2005 (gmt 0)

10+ Year Member



Reason I need to do this is we were delisted from Google and they will only relist if certain links go to a standard 404 error page. However we still want the links to be listed in Yahoo and other SE's.

Shucar

11:50 pm on Sep 24, 2005 (gmt 0)

10+ Year Member



Not sure I really explained myself perfectly the 1st time. If a link is dead/extinct then it goes to a 404 page. I want to customize the 404 page for everyone who clicks the dead link so they get my home page www.mysite.com, but if its Google then I want the standard 404 from the server.

jdMorgan

12:24 am on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shucar,

Welcome to WebmasterWorld!

You may find my comments regarding best practices for error pages in message #2 of this thread to be useful:
[webmasterworld.com...]

The simplest solution for your problem, as described, may be to use Apache mod_rewrite. One or more RewriteCond(s) examining HTTP_USER_AGENT, REMOTE_ADDR and/or REMOTE_HOST can then be used to internally rewrite (not redirect) requests for the custom 404 errordocument *pages* to different *files*, depending on the requestor.

I cannot recommend this approach, though, because it adds complexity to a critical error-reporting mechanism on your server. IMO, error handling should be kept simple so that you can always trust it to work when needed.

Jim