1. Open Notepad.
2. Save as a regular text file (for example: file.txt).
3. Upload the file to your server and rename it to .htaccess (not file.htaccess, simply .htaccess.
4. Open the .htaccess file.
5. Write these two lines into your document:
ErrorDocument 404 http://your-site.com/error.html
ErrorDocument 403 http://your-site.com/error.html
6. Create a new html document and save it as error.html.
7. Upload it to your server - that's it!
The first bit inside the File tag says that no one can view that file. The last part says to redirect to those to website incase of a 404 or 403 error. replace yourdomainname.com with the name of your domain. Now, create a file called error.html that will be your error page
Now upload to your server, and you are good to go!