Forum Moderators: phranque

Message Too Old, No Replies

How to set-up 403 error responses

without using Errordocument

         

cybertime

11:30 am on Oct 29, 2004 (gmt 0)

10+ Year Member



On mine last thread - [webmasterworld.com...] (thanks Jim for your patience and assitance) - I was advised not to use Errordocument to handle 403 reponses:

"I *strongly* suggest that you do not use Errordocument to handle 301, 302, 403, or 500 responses. You will confuse your visitors' browsers and search engine robots. This can badly affect your listings in search engine results."

Is there another way/method I can redirect a 403 error response to my custom 403 error page - www.mysite.com/403error.htm?

Thank you.

jdMorgan

1:45 pm on Oct 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let me clarify that.

I strongly suggest that you do not use ErrorDocument to redirect all of those errors to a single page, such as your index page or a site map. Each error should be handled by either the default server error document, or by a custom error document that explains what the error was and what a user can do about it. Strive to provide more information about the error than the default document, not less. And do not use error handlers as a method of your site's usual content-handling.

We see lots of people who use ErrorDccument 404 to point to their main script, so that if a specific static page does not exist, they can use the script to create a dynamic page. This is confusing to spiders, because they see a lot of pages returned from the site, but with 404-Not Found status, instead of 200-OK. This makes it difficult for them to decide which pages to index, and which to ignore. There are much better solutions available on Apache using the -f and -d flags of mod_rewrite's RewriteCond. I'm not sure about IIS's built-in support, but I'm pretty sure you can script a good solution on IIS.

Using a 301 error to redirect all missing pages to your sitemap can result in massive duplicate-content problems for your site map, which can possibly be a very bad thing if the site map is critical to the indexing of your site. I suggest you point 301 errors to a 301 error page, and use that page to provide a link to the site map, and (I hate to say this) use a 10-second-or-longer meta-refresh to go to the site map or index page after the visitor has had time to read the error message.

There is one error condition that I never use a custom error document for, and that is 500-Server Error. If you get one of these, it is good if the server can simply return the default error document. This eliminates any dependency on any other files, data, or scripts (which might be the cause of the failure). You want to avoid the situation where the server might get a second 500 error while trying to report the first one. To put this as a simple example; Do not set up the situation where the night watchman has no way to report that the secure telephone system has failed except a procedure that requires him to use the secure telephone!

Jim

cybertime

2:21 pm on Oct 29, 2004 (gmt 0)

10+ Year Member



Thank you for the clarication and insite, Jim.

I have now created a page for each error.

Thanks again.