Back in December we wrote about the new HTTP 404 (PageNotFoundError.aspx) Error Pages in SharePoint 2013. We mentioned a little bit about setting a Custom Error Page as default (Instead of PageNotFoundError.aspx) but the details of doing that were not provided.
So In this I am going to write about the Options that you have to Replace the default PageNotFoundError.aspx with a Custom Error Page that might have deployed in your SharePoint 2013 site.
Lets discuss the Options.
Option 1 : Replace the default PageNotFoundError.aspx in the Page Library – One of the easiest and Convenient way to replace default text in PageNotFoundError.aspx is to either edit the PageNotFoundError.aspx that resides in the Page Library or to delete it and replace it with a Custom error Page that has the same i.e. PageNotFoundError page name. If you choose to do this – a) You would loose the default Created Page b) you cannot replace the PageNotFoundError.aspx with a Custom Error Page that you have deployed in 15 hive.
Option 2 : Using “SPSite.FileNotFoundUrl property” – You can use the Out-of-Box SPSite.FileNotFoundUrl property of a Site to Change the URL of default Page Not Found page that is used for the entire site.You can use the following PowerShell Commands to do this –
$spsite = Get-SPSite “Web App URL”
$spsite.FileNotFoundUrl = “URL of the Custom Error Page“
Option 3 : Using SharePoint Designer 2013 (set ‘vti_filenotfoundpage’ property) – With the new Site Options in SharePoint Designer 2013, you can assign the vti_filenotfoundpage property of the site to a Custom Error Page that you might have deployed in the 15 Hive. Simply Open your Site in Designer and Under “Site Options” -> Parameters(tab) modify ‘vti_filenotfoundpage’ property to add a relative URL to your Custom error Page deployed in 15 Hive. See the Screen below –
Original Article : Here