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" />
</customErrors>

LASTLY – do an iisreset

Advertisements

About SharePoint Surfer

A SharePoint professional working in local council, experiencing the pointy end of SharePoint.

Posted on June 21, 2012, in SharePoint and tagged , , , . Bookmark the permalink. 2 Comments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: