Custom 404 Page Not Found Error page for SharePoint 2013/2016 Site Collection
Requirement: Create a customized 404 page not found error page in SharePoint.
How to create a 404 Page for SharePoint Site?
If you are working with SharePoint, then you may have noticed that there is a standard 404 error page appears when someone tries to access a page on your site that doesn’t exist. In this post, we will show you how to set up your own custom 404 error page. This will allow you to provide your users with a more user-friendly experience when they encounter a broken link.
SharePoint 2013 is shipped with a default “Page not found” error page in the “Pages” library in publishing Sites (https://intranet.crescent.com/Pages/PageNotFoundError.aspx) which works automatically when a user hits a non-existent URL.
We can either customize this page or create our own page and set it as a page not found error page. Here are the steps to create a custom 404 page not found error page:
- Go to Site Contents, Pages Library and Create New Error Page
- Customize the error page with your own styles and images
- Use PowerShell script to set the new page as default page not found error page.
$site = Get-SPSite "https://your-sharepoint-site-coll-url" $site.filenotfoundurl = "/Pages/PageNotFound.aspx" #Relative path
Using SharePoint Designer to set Custom Page not found error page:
You can also use SharePoint designer to set the custom page not found error page: Here is how:
- Open your SharePoint 2013 Site in SharePoint Designer 2013
- Select the Site object in the left side treeview, Click on Site Options button in the ribbon
- Assign the “vti_filenotfoundpage” property of the site to a Custom Error Page that you created.
- Don’t forget to hit Save button to commit your changes.
The above is applicable for setting custom error page at the site collection level. If you want to apply it at the web application level, refer to my another article: Custom 404 Page Not Found Error Page for SharePoint