I am trying to create a basic 404 page in Sitecore Habitat, completely stumped and new to Sitecore. I've created this NotFound page in the content tree using a basic page.
I have the following in my Website project. <projectName>.web.config under the app_config > include > project folder.
<settings>
<setting name="Preview.DefaultSite" value="qube" />
<!-- ITEM NOT FOUND HANDLER
Url of page handling 'Item not found' errors
-->
<setting name="ItemNotFoundUrl">
<patch:attribute name="value">/NotFound</patch:attribute>
</setting>
<!-- LINK ITEM NOT FOUND HANDLER
Url of page handling 'Link item not found' errors
-->
<setting name="LinkItemNotFoundUrl">
<patch:attribute name="value">/NotFound</patch:attribute>
</setting>
<!-- LAYOUT NOT FOUND HANDLER
Url of page handling 'Layout not found' errors
-->
<setting name="LayoutNotFoundUrl">
<patch:attribute name="value">/NotFound</patch:attribute>
</setting>
<!-- ERROR HANDLER
Url of page handling generic errors
-->
<setting name="ErrorPage">
<patch:attribute name="value">/NotFound</patch:attribute>
</setting>
</settings>
I'm getting the following error/stack trace when trying to hit a non-existing URL/page, looking at the network tab in console its a HTTP 500 server error not the 404 that I wanted:
[HttpException (0x80004005): Error executing child request for /NotFound.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +2292
System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +822
System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) +76
System.Web.HttpServerUtility.Transfer(String path) +45
Sitecore.Pipelines.HttpRequest.ExecuteRequest.HandleItemNotFound(HttpRequestArgs args) +845
(Object , Object[] ) +74
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Nexus.Web.HttpModule.(Object , EventArgs ) +525
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92