Forum Moderators: phranque
QUESTION:
Is there any way to configure apache so that it does not redirect them to the filenotfound.htm but instead display a CUSTOMIZED 404 error massage while still displaying the "url incorrect url entered by the visitor - that does not exist" in the web brower.
If you go to a page that does not exist on this webmasterworld domain, you'll see that incorrect url stay in the browser url field, but you still get the 404 error message.
Finally, is doing this really necesary? I want to avoid google from indexing pages that no longer exist. Would simply, redirecting visitors to the filenotfound.htm page work for google. Or does google require no redirecting... the need the 404 error show for each incorrect page visited?
Any help would be appreciated.
Thanks
Surfpro203
You might want to check your server response headers using the "Live HTTP Headers" extension to Firefox, or *several* on-line tools (because some of them only show the final server response, and will thus "hide" any intervening redirects), and verify that your implementation is correct. Based on what you've written, it sounds like it is not.
The single most common error in defining custom error documents on Apache is the use of a full URL in the directive, such as this incorrect example:
ErrorDocument 404 http://www.example.com/404error.html
The correct form is:
ErrorDocument /404error.html
Jim
ErrorDocument /index.html
This way visitors clicking any bad links would never be sent to an error page and instead be sent to your sites home page.
Would there be any problems using that method? Especially in regards to Google. Is there any other aspect I may be overlooking where this wouldn’t be a good idea?
Thanks!
I recommend that you use the HTTP protocol as it was designed -- A missing page should result in a 404-Not Found error, and an intentionally-removed page should result in a 410-Gone error.
When making technical decisions, the effects on your site's search engine ranking cannot be safely ignored.
Jim
Also stated elsewhere, but worth repeating, is that your custom error pages should have as few dependencies as possible. And the more severe the error, the fewer dependencies the error page should have.
For example, using a dynamically-generated 500-Server Error page is problematic, because if your script interpreter fails and causes a server error, then another server error will be invoked when the error handler tries to use the same script interpreter to create the error page, and another because of that -- ad infinitum.
I recommend a simple 500-Server Error page -- no images, no external stylesheets, no JavaScript, no server-side includes. Similar care should be taken with the 403-Forbidden and 503-Service Not Available error pages. 404 and 410 errors are not quite so critical, but a conservative fewest-possible-dependencies approach is safest.
Jim