Blog Archives

How to Create a Custom Error Page on SharePoint

In a previous blog I explained how to Create a custom Page Not Found page on SharePoint 2010.  This is particularly useful for external facing publishing sites.

In this post I show how to add a custom error message for other types of error (4xx, 5xx).  Timeout, Bad Request etc.

  1. Firstly create your custom error page as you would create a normal page, e.g. “/Pages/ErrorPage.aspx”  Create one page for all errors or ones specific to each area you want a custom error message for.  You may want to remove these pages from the search results and navigation.
  2. Log on to your SharePoint server and naviagate to the web.config for the web application (and take a backup then) open in textpad or other editor
  3. Find the customErrors section and update as following…

If you have one page for all the errors update to

<customErrors mode="On" defaultRedirect="/Pages/ErrorPage.aspx"/>

If you create various pages for the different errors then you will need to use something like this

<customErrors mode="On" defaultRedirect="/Pages/ErrorPage.aspx">
<error statusCode="400" redirect="/Pages/Error400.aspx" />
<error statusCode="401" redirect="/Pages/Error401.aspx" />
<error statusCode="500" redirect="/Pages/Error500.aspx" />

LASTLY – do an iisreset


Doing more with SharePoint with PowerShell ISE

PowerShell ISE is a much more convenient way to write and execute SharePoint PowerShell scripts, but you have to perform a few extra steps after the default installation to get PowerShell ISE up and running.

Scot Hilier has written an excellent step by step guide in how to set up PowerShell ISE for SharePoint

Once you have done that check out this Powershell cheat sheet.

Now you will never need to login to ‘Central Admin’ again