The use of this .htaccess is to enable you to redirect your website visitor to a predfined custom error page (termed as 404 ) in case something goes wrong. Let’s have an example to understand why we need it.
Suppose visitor searched something on your website which is not there or has been removed or something went wrong .! Now chances are user may see something very irritating or get something out of the world! This may not be a good thing for your effective website and your valuable visitors.
You may also set an email alert when you need to know how visitor landed to 404. So you can understand visitor's requirement or improve the website and serve your visitor better in future. In case there are some broken link issues, you can rectify them too.
You can set custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file:
#add this to your .htaccess file ErrorDocument 404 /your_custom_page_url.html
This will redirect visitors to the specified error page and tell them requested page doesn't exist.
If you have any issue, let us know in the comment box.