Redirect

N

Nitin

I want to redirect users to my hope page if the referrer is not my domain,
how can i do that??. I've been using this code in session_start it doesn't
seem to work all the time
Thanx
Nitin

Try

If Request.UrlReferrer Is Nothing Then

If InStr(Request.Path.ToLower, "/default.aspx") = 0 Then

Response.Redirect("Default.aspx")

End If

Else

If InStr(Request.UrlReferrer.ToString, "mydomain") = 0 Then

Response.Redirect("default.aspx")

End If

End If



Catch ex As Exception

Response.Redirect("default.aspx")

'Response.Write(Request.UrlReferrer.ToString)

End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,998
Messages
2,570,242
Members
46,835
Latest member
lila30

Latest Threads

Top