Does anyone know how you can get Umbraco to handle 404's of custom mvc routes? Is there a way to get it to redirect to the custom umbraco configured page? or do you just have to do like a generic catch all custom 404 page like in a straight mvc app?
So if i went to /quiz/question/1234 for example it returns 404 which i want it to. I just dont want the iis default page. Im wondering is it possible to configure it to return the configured 404 page asif it wasnt a hijacked route?
Custom Route 404 Errors
Does anyone know how you can get Umbraco to handle 404's of custom mvc routes? Is there a way to get it to redirect to the custom umbraco configured page? or do you just have to do like a generic catch all custom 404 page like in a straight mvc app?
Having a quick look at the answers to an mvc 404 http://stackoverflow.com/questions/553922/custom-asp-net-mvc-404-error-page
It looks like you'd have to change the httperrors from pass through, wont this have a knock on effect for the umbraco 404 handler?
Generally you can set the error node ID for 404 errors in umbracoSettings.config in config folder as below:
But recently I had some problem with this, so I decided to move it to IIS level:
Select your site then
ErrorPages -> Edit 404 and / or 500 to /YourErrorPageUrl.aspx
Also this discussion could be useful for you:
http://our.umbraco.org/forum/developers/extending-umbraco/41367-Umbraco-6-MVC-Custom-MVC-Route
@Amir
Yeah I've implimented the usual Custom Umbraco 404 which works fine if say for example you go to an obvious page that doesnt exisit /sdfsdhfjbdfjsd
However if you try and go to an action which is say [AjaxRequest] on a get request, it returns the iis default 404 page.
heres my custom route
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication,
ApplicationContext applicationContext)
{
//Create a custom route
RouteTable.Routes.MapRouteLowercase(
"Quiz Questions",
"quiz/{action}/{id}",
new
{
controller = "Quiz",
action = "Index",
id = UrlParameter.Optional
});
WebApiConfig.Register(GlobalConfiguration.Configuration);
}
So if i went to /quiz/question/1234 for example it returns 404 which i want it to. I just dont want the iis default page. Im wondering is it possible to configure it to return the configured 404 page asif it wasnt a hijacked route?
is working on a reply...