Customizing error pages


I want to give my site more professional look by providing my user my customized error page, when he tries to open the non-existing page. Please do provide me the steps, for using .htaccess for doing this.

You can customize error pages, but for that you need to know the error number like 404 for page not found.

Now in .htaccess file you need to enter:

ErrorDocument errornumber /file.html

For example if, there is a file, NotFound.htm in error directory, and you wanted to use it for the 404 error, then you need to enter:

ErrorDocument 404 /error/NotFound.htm

These are some of the most common errors:

401 – Authorization Required
400 – Bad request
403 – Forbidden
500 – Internal Server Error
404 – Wrong page