Replace default PageNotFoundError page in Pages library:
In SharePoint as soon as you enable publishing features you can see a default error page in Pages library with the path “<<Site URL>>/Pages/PageNotFoundError.aspx”.
Follow the below steps to change the default page:
1. Logon on to sharepoint site
2. Open Site content
3. Click on Pages Library
4. Delete the existing “PageNotFoundError” page
5. Create a new error page by clicking on “Error Page” option.
Update the default error page using PowerShell:
The issue or drawback with the above approach is we will be losing the default error page. We can update the default association of pageNotfoundError page using the below PowerShell commands to a custom or user defined page.
Create a custom page “userErrorPage” by following the steps 3 to 6.
Once you create the custom error page execute the below commands to change the default association.
$objSpSite = Get-SPSite “<<Web site URL>>”
$objSpSite.filenotfoundurl << This will show the existing file not found error page >>
Change the file not found error page in SharePoint designer:
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.
The output will be as follows:
Hope this helps, happy development in SharePoint !!!!
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials:
About Krishna Vandanapu
I am Krishna.Vandanapu a SharePoint architect working in IT from last 12 years, I worked in SharePoint 2007, 2010, 2013, 2016 and Office 365. I have extensive hands on experience in customizing SharePoint sites from end to end. Expertise in SharePoint migration tools like Sharegate, Doc Ave and Metalogix. Migrated SharePoint sites from SharePoint 2007 to 2010 and 2010 to 2013 several times seamlessly. Implementing CSOM with Microsoft best practices. Spent quality time in configuring SharePoint application services like User Profile, Search, Managed Meta data services etc. Now exploring SharePoint Framework and SharePoint 2019
Your FREESharePoint Online Ebook is on its way to your Email Inbox. **************** You will get notification on FREE SharePoint online training, SharePoint webinars, Video Tutorial & also latest FREE PDF tutorials