共用方式為


How to Customize Error Page, Page Not Found and Access Denied in SharePoint 2010

There are many ways to customize these pages for example you can customize by code by creating a feature at web application scope or you can do it by power shell so let’s see the simple way.

First create three pages and place them in this path

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\

Custom_Error.html

Custom_NotFound.html

Custom_AccessDenied.html

Note: if you have multilingual site you need to place these pages in their language folder for example for Arabic

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1025\

Second Open SharePoint 2010 Management Shell with Farm Administrator User

Now For Custom page Not Found runs the following Power Shell:

 $webApp = Get-SPWebApplication https://test 
$webApp.FileNotFoundPage = “Custom_NotFound.html” 
$webApp.Update() 

For Custom Error Page, Access Denied page,.. All pages listed in the below image

Run the following Power Shell:

 

 $webApp = Get-SPWebApplication https://test
$webApp.UpdateMappedPage([Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage]::Error,"/_layouts/1033/Custom_Error.html") 
$webApp.Update() 

Ref: https://salvatoredifaziosharepoint.blogspot.com/2012/03/how-to-customize-sharepoint-2010-error.html

 

[Updated in 26/1/2016] , For SharePoint 2013:

  1. Make sure to update the SharePoint Farm with April 2014 Cumulative Update(CU) or higher.
  2. Make sure to use this path /_layouts/15/ for your custom pages
    For example 
    $webApp.UpdateMappedPage([Microsoft.SharePoint.Administration.
    SPWebApplication+SPCustomPage]::Error," /_layouts/15/errorf404.html")

Comments