These notes apply to the Apache web server. Using a text editor create the file '.htaccess' without the quotes if you already dont have this file in place. It should contain either the line:
ErrorDocument 404 http://www.yourdomain.com/custom404page.htm
or:
ErrorDocument 404 /custom404page.htm
This assumes that your custom 404 page is called 'custom404page.htm'. If you have created the '.htaccess' file on a Windows machine then check and see that Windows has not added a file extension.
Difference between these two versions, both will give you a custom error page, but there are subtle differences:
ErrorDocument 404 http://www.yourdomain.com/custom404page.htm
This will cause the web server to issue a redirect, redirecting the user to the page. Should you want this allows you to redirect the visitor to a page on another site. Another key difference is that any web robots will receive the status 200 back from the server (page okay) rather than 404 which is page not found.
Whereas:
ErrorDocument 404 /custom404page.htm
Will cause the web server to use the page it finds at the root (i.e. the top or main) folder for your website. The slash at the start '/' tells the server to get the file from the root (or top most) folder. This method has the advantage that any web robots will receive the 404 status back from the server (i.e. page not found). It has the disadvantage that any relative links can easily be broken - because if the user were trying to view a page in a sub-folder then any relative links will be relative to that sub-folder, not the folder that the custom 404 page is in. So either use absolute URLs or use the BASE element to specify an absolute base for (relative) links.
Once you have written both '.htaccess' and 'custom404page.htm' files you should upload them to the server and that should be it.