Forum Moderators: phranque
As to whether the home page is the best place to redirect to, it probably depends on the size of your website and the number of 404 errors it typically generates. The end-user doesn't realize that they are getting to your home page because of a 404 error, so they could become confused. That's why many sites have a page that explains that the file wasn't found, and include a mini site map to popular areas so the user might be able to find what he/she wanted.
In this case, your logs can be your friend. Look for the 404 errors in your logs to see if there are any real patterns. If you see a lot of requests for one specific file, perhaps from an external link to old content, consider creating a page to replace it (or see if there is already one on your site that matches the theme of the old file, and do a 301 redirect for it specifically).
In any case, make sure that if you set up a custom error page, it actually returns the proper 404 response to the browser/spider using a server header checker. If you return a 200 or a 302, you risk a duplicate content penalty.
Can you explain how the above can be done? I was under the impression that you don't need to do anything like that?
the reason you want a 404 status is to tell the search engines that content was not found.
otherwise they will be satisfied using your custom "404 error page" as content since it actually returned a 200 OK status.
according to the HTTP/1.1 specification (http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html),
the very first line of an http response message is the status line.
in this case you would use
HTTP/1.1 404 Not Found
the trick is finding out where this line is actually being generated for your server.