473,804 Members | 3,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

forwarding a request from a specific ip

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!
Nov 19 '05 #1
5 1606
Hi Brian:

Have you investigated the Request.UserHos tAddress property?
The Response.Redire ct method?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Mar 2005 15:34:29 -0500, "Brian Henry"
<br**********@n ewsgroups.nospa m> wrote:
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!


Nov 19 '05 #2
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.
"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:3i******** *************** *********@4ax.c om...
Hi Brian:

Have you investigated the Request.UserHos tAddress property?
The Response.Redire ct method?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Mar 2005 15:34:29 -0500, "Brian Henry"
<br**********@n ewsgroups.nospa m> wrote:
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!

Nov 19 '05 #3
Show us some code and, perhaps someone will spot something...

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Mar 2005 23:08:17 -0500, "Brian Henry"
<br**********@n ewsgroups.nospa m> wrote:
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.


Nov 19 '05 #4
from global.asax

Sub Application_Beg inRequest(ByVal sender As Object, ByVal e As EventArgs)

' Fires at the beginning of each request

If Request.UserHos tAddress = "68.70.115. 112" Then

Response.Redire ct("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



"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:vb******** *************** *********@4ax.c om...
Show us some code and, perhaps someone will spot something...

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Mar 2005 23:08:17 -0500, "Brian Henry"
<br**********@n ewsgroups.nospa m> wrote:
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.


Nov 19 '05 #5
Try the same thing in Sub Session_OnStart

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Brian Henry" <br**********@n ewsgroups.nospa m> wrote in message
news:eB******** ******@TK2MSFTN GP14.phx.gbl...
from global.asax

Sub Application_Beg inRequest(ByVal sender As Object, ByVal e As EventArgs)

' Fires at the beginning of each request

If Request.UserHos tAddress = "68.70.115. 112" Then

Response.Redire ct("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 "Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:vb******** *************** *********@4ax.c om...
Show us some code and, perhaps someone will spot something...

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Mar 2005 23:08:17 -0500, "Brian Henry"
<br**********@n ewsgroups.nospa m> wrote:
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.



Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2294
by: Agoston Bejo | last post by:
Hi. x1.asp: <form method="post" action="x2.asp"> .... </form> x2.asp: DoSomeAdministration() Response.Redirect "x3.asp?" & Request.Form x3.asp: further processsing of data
5
4091
by: shreya | last post by:
I have a jsp CustomerLogin.jsp which takes customerid and a servlet forwarding request object to another jsp records.jsp. In this records.jsp i have a button calling another jsp Customer.jsp.I want request object i.e customerid here.How can i get that.Using request dispatcher displays both records.jsp and customer.jap in same page.I dont want that Pls help..
1
2494
by: thomas | last post by:
Hello all, It seems like subdomain forwarding prevents ASP.Net session state from working correctly. Example: two websites http://www.jgphotographers.com/test and http://picturestore.newpicturestore.com/test - the first one works - the counter using session state increases every time the button is clicked. The second one uses subdomain forwarding with masking. The "picturestore"
6
3545
by: mcl | last post by:
I have a domain name which is set up for web forwarding with a frame. I have a link on one of the site's pages to an external site. When I select the link the external site is displayed correctly with its own URL in the address bar. When I select the <backbutton in the browser, my domain name appears temporarily in the browser, but it returns to the external site. If I look at back History (In Firefox) there are two entries for my...
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9130
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.