<img alt="" src="https://secure.make6pain.com/194280.png" style="display:none;">

How to Create a Custom Error Page for SharePoint

CreateCustomError.png

Branding your digital workspace is essential to creating a company identity. This includes not just the functional pages, but even the error pages. SharePoint development can be a headache to get the hang of. To learn how to create custom error pages in SharePoint, follow this tutorial. 

 

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. 

 

     

Step #1:  Create the custom HTML file:

1.  On the computer that is running SharePoint Server 2010, copy the Sps404.html file to a temporary folder. 

2.  Rename the Sps404.html file. For example, give the file the following name: Custom404.html

3.  Modify and design the new Custom404.html file to suit your needs for a custom 404 error message using notepad or an HTML editor.

4.  Copy the Custom404.html file to the %systemdrive% \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID folder.

 

   

Step #2:  Run the following PowerShell commands from the SharePoint 2010 Management Shell:

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

 

 

Step #3:  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!

 

For more tricks like this one, make sure to subscribe to the Codesigned blog! For a completely customized SharePoint experience, check out IntranetPro. 

Learn More

Related Content