HOME ABOUT
I AM HERE
Bookmark and Share

Setting up a SharePoint custom error page

June 17, 2009 15:24 by AidanG

The process for creating a custom error page for SharePoint is different from how you would normally set one up for a website hosted by IIS.

First create your custom error page as an html document.

Save the custom error page to the following location:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033

The error page then needs to be assigned to the web appication it is to be used for. Because the custom error page is assigned at the web application level you can create a different page per web application if required.

The assignment is done with the following code:

  Microsoft.SharePoint.Administration.SPWebApplication webapp =
            Microsoft.SharePoint.Administration.SPWebApplication.Lookup(new Uri([site url]));
            webapp.FileNotFoundPage = [errorpage.html];
            webapp.Update();

Replace [site url] and [errorpage.html] with the relevant values for your site and your error page.

To test that this has worked try to navigate to a page on your site that does not exist. Rather than seeing the standard page not found error you should now see your custom page. 


Tags:
Categories:
Actions: E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed

Comments

June 17. 2009 19:58

Pingback from web2designer.org

Setting up a SharePoint custom error page | Web 2.0 Designer

web2designer.org

June 18. 2009 13:55

Cheers Aidan - simple but very handy. Standard error pages always seem to generate support calls or cries for help as people assume something is broken or they've done something wrong. Custom pages are much better as you can embed more information and even suggested workarounds etc.

Simon K

June 24. 2009 10:27

Yes, the whole process in SharePoint, really different from the normal process, I now know it.

Enlarging

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading