Sign In

 ‭(Hidden)‬ Site Redirect

Feb 06
Creating a custom error page for a SharePoint 2010 web application

​To create a custom error page for SharePoint, in Windows Explorer, locate the following folder:

%systemdrive% \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID 
 

*Note: 

  • In this path, %systemdrive% represents the actual drive name of the drive on which the operating system is installed.
  • In this path, LangID represents the actual language ID of the language that you use. For example, 1033 is the language ID for U.S. English. 
     

Create the custom HTML file:

On the computer that is running SharePoint Server 2010, copy the Sps404.html file to a temporary folder. 
Rename the Sps404.html file. For example, give the file the following name: Custom404.html
     
Modify and design the new Custom404.html file to suit your needs for a custom 404 error message using notepad or an HTML editor.
 
Copy the Custom404.html file to the %systemdrive% \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID folder.
     

Run the following PowerShell commands from the SharePoint 2010 Management Shell:

$webapp =Get-SPWebApplication http://<serverUrl>:<port>
$webapp.FileNotFoundPage = "Custom404.html"
$webapp.update()

 
Verify that the property is set by running the following command:
(Get-SPWebApplication http://<serverUrl>:<port>).FileNotFoundPage 

 

Additional Notes:

  • In this code, <serverUrl> represents the actual URL of the Web application where you are setting the custom 404 error page. 
  • In this code, <port> represents the nonstandard port number, if any, that is assigned to the Web application. 
  • In this code, Custom404.html represents the actual name that you created for the custom HTML file.  ​
  • By default in SharePoint Server 2010, the FileNotFoundPage property is set to the "null" setting.

 

Enjoy!