If you do not have custom files for handling error conditions and error codes like 404 ,500 and 401 etc ,the user experience would not be great. No one prefer to see the “404 Not Found” on their browser.The website developer should handle these scenarios.
You can do this by specifying the custom error document in your server web server configuration files.For Apache server you can do this by editing the .htaccess file.
Here given below are few of the common error codes and we can handle these
Client request Errors400 – Bad request
401 – Authorization Required
403 – Forbidden
404 – Not Found
401 – Authorization Required
403 – Forbidden
404 – Not Found
Server Errors
500 – Internal Server Error
501 – Not Implemented
502 – Bad Gateway
503 – Service Unavailable
504 – Gateway Timeout
505 – HTTP Version Not Supported
500 – Internal Server Error
501 – Not Implemented
502 – Bad Gateway
503 – Service Unavailable
504 – Gateway Timeout
505 – HTTP Version Not Supported
Here is the syntax to specify the error document.
if you use the second example above you can keep the custom error file in any directory and use the directory name to replace “directory”.
For example
Even though it is not advised you can specify a full URL rather than a virtual URL in the ErrorDocument string like http://abcd.com/errors/notfound.html rather than /errors/notfound.html.
This document is found from this is site: http://www.globinch.com/2010/03/25/how-to-specify-your-own-errordocuments-using-htaccess-file/Please feel free to comment to make it more useful to everyone.
0 comments:
Post a Comment