I've replaced Umbraco's default RenderMVCController using the last section here. I would like to return the same view regardless if Umbraco finds a template or not (this view returns a single page app):
public class DefaultRenderMvcController : RenderMvcController
{
public override ActionResult Index(ContentModel model)
{
return View("~/Views/DefaultPage/Index.cshtml", model);
}
}
Since my document types doesn't have templates (they are managed in the single page app), I get the default Umbraco 404 page.
How can I make the 404 request end up in my DefaultRenderMvcController? Right now Index() isn't called.
Hijack all requests including 404
I've replaced Umbraco's default RenderMVCController using the last section here. I would like to return the same view regardless if Umbraco finds a template or not (this view returns a single page app):
Since my document types doesn't have templates (they are managed in the single page app), I get the default Umbraco 404 page.
How can I make the 404 request end up in my DefaultRenderMvcController? Right now
Index()
isn't called.I don't think you can, the 404 handler has to be a document type in Umbraco.
Hi
This is a way to make a custom 404 handler -
https://our.umbraco.com/documentation/reference/routing/request-pipeline/IContentFinder#notfoundhandlers
Thanks, Alex
is working on a reply...