1. Go to _layouts/1033 folder and find SPS404.html.
2. Copy this SPS404.html and paste it at same location.
3. Rename this new file for eg : SPSCustom404.html.
4. Edit SPSCustom404.html file in any text editor.
5.Search for STSNavigate(“/Pages/Pagenotfound.aspx?oldUrl=” + requestedUrl);
6. /Pages/Pagenotfound.aspx is the page location which you want to display in case of HTTP 404 error occurs.
7. Once you done with editing, save and close this file.
8. Open SharePoint 2010 Powershell.
9. Run below command
$WebApp = Get-SPWebApplication “siteurl”
$WebApp.FileNotFoundPage = “SPSCustom404.html”
$WebApp.Update()
Now you are done, just type a wrong page name with your webapp url and see the result.
If this is useful for you, do not forget to like us on facebook.