Copied to clipboard

Flag this post as spam?

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


  • Dan Diplo 1505 posts 5911 karma points MVP 4x c-trib
    Jan 06, 2012 @ 17:21
    Dan Diplo
    0

    Adding/Accessing the Referrer to custom 404 Pages

    Is there anyway to add the HTTP Referer to the URL of a custom Umbraco 404 page? This is useful for finding out the page the visitor requested that caused the 404 error. It's also really useful in Google Analytics tracking for this reason, too.

    Basically, what I'd like is the URL to contain the refferer. So, imagine a visitor types in:

    http://www.mysite.com/donkeys.aspx

    However, the "donkeys" page has been deleted so they get redirected to my custom error page called NotFound:

    http://www.mysite.com/notfound.aspx

    What I'd like is for the "notfound.aspx" page to add in the referering URL as part of the query string like this:

    http://www.mysite.com/notfound.aspx?referer=http%3A%2F%2Fwww.mysite.com%2Fdonkeys.aspx

    Is this possible in Umbraco? Whenever I try and access HttpContext.Current.Request.UrlReferrer in an error page I get nothing. Same goes for document.referrer in javascript.

     

  • Funka! 398 posts 660 karma points
    May 05, 2012 @ 00:12
    Funka!
    0

    Bump! Anyone have an answer to this?

    Thanks!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies