A great change in the new version of SharePoint Server is that there is a support of Custom HTTP 404 Error Pages. In this post we will take a look how to create a new 404 page.
All Publishing sites contain a default a 404 Error page “PageNotFoundError.aspx” page which is added to the App "Pages Library" therefore connect to a Publishing site. If you don’t have any publishing sites, check the image, to see how to create one.
After you create your site, you can go to your site’s contents and check under your App "Page library" for the current and out-of-the-box PageNotFoundError.aspx
To allow users to create a new custom Error page, Publishing Sites now contain a new Content Type “Error Page“. This Content type Inherits from “Page” Content type and has a typical layout of a Page Not found. To find this Content Type, Navigate to Site Settings -> Content Types -> Error Page.
You can modify this page to add some text or images. But we want to create a new custom Error Page. For this go back to your App "Page Library" and create a new document "Error Page"
Provide some information and be sure that you select an (Error Page) Error.
Title: Custom Error Page
Description: Custom Error Page gknzcfc.net
URL Name: Custom-Error-Page
You will now see your new page appearing under your App.
Check out, and make modifications to your page. I’m a huge lover of Doctor House, so I added a picture of him to make clear that the page was not found :^)
I received 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 the SPSite server relative URL or absolute URL to the file not found page. This value is used as a redirect URL for an 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?
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?
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 the error.aspx with notepad and paste the following items to get a LOGO and a HYPERLINK:
<asp:Panel id="ErrorPageTitlePanel" runat="server" tabindex="0"> <img src="vcg.jpg"/><br/><br/>Vision Consulting Group:</span> < /asp:Panel>
<asp:Panel id="PlaceHolderPageTitleInTitleArea" runat="server"><p> <a href="mailto:email@example.com?subject=New SharePoint Incident&body=<Please provide a short description and paste error >">Log SharePoint Support Ticket</a></p></asp:Panel>
You can choose where you want to copy those elements (think logic). 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 clicks on "Log SharePoint Support Ticket" Outlook will open a new message and the user has only to enter some information and click "send"…