forwarding a request from a specific ip

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

I want to be able to forward any request from my one site to another site
based on the IP address... kind of like denying access to the site if an IP
is a certain one if they try to access any page on it and forward it to like
google.com or something, how would you go about doing this? and can you do
it for ranges also? thanks!
 
Hi Brian:

Have you investigated the Request.UserHostAddress property?
The Response.Redirect method?
 
I have, and put it into the Begin Request of the global.asax file trying to
forward any requests at the beginning of the request if it was in a list of
IP's but it doesn't seem to work at all.
 
from global.asax

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)

' Fires at the beginning of each request

If Request.UserHostAddress = "68.70.115.112" Then

Response.Redirect("http://www.google.com")

End If

End Sub



now i know that should work, but it doesn't for some reason... when i step
through the project that doesn't even seem to fire when a request is made on
the site for some reason
 
Back
Top