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;
}