Share via


SharePoint 2013: How to Modify Error Pages

I wrote a few days ago a new article about custom error pages and want to begin first with a little endorsement about it! You can find the article here: http://www.gknzcfc.net/subsite/custom-error-pages-on-sharepoint-2013.html

I got a question from Isha [MVP sharepoint] asking about "how we could set a custom error page as default

The answer is quite simple:

  • Rename "your" custom error page to PageNotFoundError.aspx and delete the out-of-the-box 
  • Use the FileNotFoundUrl via Visual Studio. Get SPSite server relative Url or absolute URL to file not found page. This value is used as redirect URL for HTTP request where the resource cannot be found.

 

But, what if you do not want to create a new one, but only want to modify? The blog post today will show you how to modify your current and also out-of-the-box error page.

We’ve all seen it; the SharePoint 20xx error message is something terribly not "user-friendly".

Now, I like the Correlation ID and being able to track the error down. However, in real world scenarios it’s unlikely that our users will leave this screen up and copy/paste to our support group. Wouldn’t it be nice to have a warmer error message with our company logo and a link that will ask the user to send the error details?

 

  • Therefore Connect your Application Server and navigate to 15>TEMPLATE>LAYOUTS

 

  • Locate and copy the error.aspx file. Never never never ever touch the system files…make copies and use those and if something goes wrong you can always come back.

  • Open error.aspx now with notepad and the 2 following items:

 

Logo

<asp:Panel id="ErrorPageTitlePanel" runat="server" tabindex="0">

<img src="vcg.jpg"/><br/><br/>Vision Consulting Group:</span>
< /asp:Panel>

 

Ticket Link

<asp:Panel id="PlaceHolderPageTitleInTitleArea" runat="server"><p>

<a href="mailto:info@gknzcfc.net?subject=New SharePoint Incident&amp;body=&lt;Please provide a short description and paste error &gt;">Log SharePoint Support Ticket</a></p></asp:Panel>

 

  • You can choose where you want to copy those elements. When finished you can save and try to get a Correlation ID. If everything went right, you should receive an error screen like this:

  • And when somebody cliks on "Log SharePoint Support Ticket" Outlook will open a new message with some information and the user has only to click "send" ..