Copied to clipboard

Flag this post as spam?

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


  • Brian Powell 44 posts 199 karma points c-trib
    May 30, 2013 @ 02:31
    Brian Powell
    0

    Changing Displayed Page in AfterRequestInit Event Handler

    I wrote an AfterRequestInit event handler so that part of my Umbraco 6.0.5 site can function as an Intranet.  For pages where I have the "Intranet" property set, the server checks the client URL to see if it's in the allowed subnet.  If it is, it's allowed through.

    For users not in the allowed subnet, I want to display an "Unauthorized" error page that I created in Umbraco.  I'm having trouble figuring out how to tell Umbraco to display that page instead of the original page.  Context.RewritePath(newUrl) doesn't consistently work and when it does, it gives a 302 redirect rather than just internally rewriting the page.

    Any ideas how I can tell Umbraco to display a different page instead of the one originally requested without causing a browser redirect?

Please Sign in or register to post replies

Write your reply to:

Draft