We have some domains that redirect to our main site but have the url masked.
For e.g. you visit http://foo.com
and you are redirected to http://bar.com
but the address bar remains http://foo.com
.
I want to be able to modify the url shown by way of a redirect or similar to the actual url you are viewing (un-masked).
I thought something like this would work (and it does when running on localhost) but on the live site the url is still masked.
In Global.asa.vb:
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim url As String = HttpContext.Current.Request.Url.ToString
If Not url.ToLower.Contains("foo.com") Then
resp.Redirect("http://bar.com" + HttpContext.Current.Request.Path, True)
Exit Sub
End If
End Sub