Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthew Kirschner 323 posts 611 karma points
    Sep 11, 2015 @ 16:35
    Matthew Kirschner
    0

    Redirect to Umbraco Error Page for HttpStatusCodeResult

    I'm in a bit of a bind and can't figure out why Umbraco is returning a blank page for my 403 results. Here's the deal:

    I've already set up the umbracoSettings.config to redirect to some nodes on specific errors:

    <errors>
      <error403>3490</error403>
      <error404>2962</error404>
    </errors>
    

    This works well already for 404s, but I can't seem to get it to work for the 403. I always seem to get a blank page, even though I have the page created (with ID: 3490) in the backofffice.

    Perhaps the issue is with how I'm sending the 403 result? I have a custom controller setup that doing some manual authorization for members. Using an override of the OnActionExecuting method, the controller verifies that the member has access to the page, and if they don't, it updates the filterContext send a 403 result. Like so:

    filterContext.Result = new HttpStatusCodeResult(HttpStatusCode.Forbidden);
    

    Does anyone have any ideas why Umbraco might not be returning the proper error page?

Please Sign in or register to post replies

Write your reply to:

Draft