Blog Archives

Create a custom Page Not Found page on SharePoint 2010

I’m sure all your SharePoint sites are far too great to have any internal broken links šŸ˜‰

But there may be a situation when someone incorrectly links to your SharePoint site and you want to give a custom error page to provide a ‘nicer’ Ā 404 failure page and provide an opportunity for the user to seek more help or to be able to navigate elsewhere on your site.

go from this

page not found

to something like this

custom page not found

Here is how you do it

1. Create your custom ‘page not found’Ā page and approve it. Ā You probably Ā also want to remove it from any navigation and exclude it from search results. Ā I created my custom error page in the pages directory of the root site.

2.Ā go to ..\14\TEMPLATE\LAYOUTS\1033 and take a copy of sps404.html and rename the copy to custom404.html

3. edit the file so that stsnavigate line points to the page you created in step 1


4. Open sp2010 management shell and run the following PowerShell commands (change <sitename> to yourĀ site URL)

$webapp =Get-SPWebApplication http://<sitename&gt;
$webapp.FileNotFoundPage = "custom404.html"

ToĀ redirect to a custom error page for other http errorsĀ see my other blog on How to Create a Custom Error Page on SharePoint