This is a user manual for MoutasemA.SPMyError project, which helps customizing SharePoint Mapped pages.

Customize Mapped Pages

Mapped pages is a new property added to SPWebApplication in SharePoint 2010 object model allowing customization for the following page types

  • Access Denied
  • Confirmation
  • Error
  • Login
  • Request Access
  • Sign-out
  • Web Deleted

You can refer here and here for more information. The following points show how to customize  a mapped page by entering  page URL hosted under “/_layouts/” virtual directory (C:\Program Files\Microsoft Shared\Common Files\Web Server Extensions\14\Template\Layouts):

  1. To start managing the mapped pages, go to Central administration > Application Management > Manage Web Application
    image
  2. After selecting the needed Web Application, click on Manage Mapped Pages and select a page type to customize
    image
  3. Enter a valid URL for your custom page (Must be hosted under /_layouts/)
    image
    image
  4. Verify the recent settings by navigating to a page throws error, or by going directly to the OOB error page (/_layouts/Error.aspx)
    image
  5. To reset settings, Re select the proper page type and enter blank (empty) value then save.
    image

Customize 404 (Page not found)

Since SharePoint 2007 it was possible to customize the 404 response (Requested page not found) by changing SPWebApplication.FileNotFoundPage property. The custom page should be :

  • Hosted under “/_layouts/LangId” For example: C:\Program Files\Microsoft Shared\Common Files\Web Server Extensions\14\Template\Layouts\1033 for English language as mentioned here
  • Strictly copy sps404.html page under “/_layouts/LangId” then apply your changes, If you tried to copy and paste the contents only your page might fail under different browser (For example FF will show the HTML markup instead of rendering it) as mentioned here
  • This custom page will do redirection to another page hosted under “/_layouts/” that will show the custom response.

So in a nutshell, you need to create two pages, one to do redirection and the other to show the custom response (ASPX or HTML page), The steps to do so are mentioned below:

  1. go to Central administration > Application Management > Manage Web Application
    image
  2. After selecting the needed Web Application, click on Manage Mapped Pages and select “404 File not found” page type to customize
    image
  3. Enter a valid URL for your custom page (Must be hosted under /_layouts/langid, and you need to enter the page name only)
    image
    image
    image
  4. Verify the recent settings by navigating to invalid URL
    image
  5. To reset settings, Re select the proper page type and enter blank (empty) value then save.

Last edited Apr 15, 2011 at 8:53 PM by moutasema, version 5

Comments

No comments yet.