Surendra Sharma

Surendra Sharma

Search This Blog

Wednesday, June 5, 2013

Create NotFound page for 404 error in Sitecore

Create template, layout and content for Notfound page.
Changes in web.config file
<setting name="ItemNotFoundUrl" value="/Notfound.aspx"/>
<setting name="LayoutNotFoundUrl" value="/Notfound.aspx"/>
<setting name="LinkItemNotFoundUrl" value="/Notfound.aspx"/>
<setting name="NoLicenseUrl" value="/Notfound.aspx"/>


In Notfound.aspx page write below code
protected void Page_Load(object sender, EventArgs e)
{
Response.Status = "404 Not Found";
Response.StatusCode = 404;
}

No comments:

Post a Comment