BVNetwork.NotFound.Core.Custom404Handler.GetReferer C# (CSharp) Method

GetReferer() public static method

public static GetReferer ( Uri referer ) : string
referer System.Uri
return string
        public static string GetReferer(Uri referer)
        {
            string refererUrl = "";
            if (referer != null)
            {
                refererUrl = referer.AbsolutePath;
                if (!string.IsNullOrEmpty(refererUrl))
                {
                    // Strip away host name in front, if local redirect

                    string hostUrl = SiteDefinition.Current.SiteUrl.ToString();
                    if (refererUrl.StartsWith(hostUrl))
                        refererUrl = refererUrl.Remove(0, hostUrl.Length);
                }
            }
            return refererUrl;
        }