Redirection based on user IP

J

jann

Hi - is it possible to have an intro page which redirects to page A (and
rest of site) for 99% visitors, but which redirects to page B for users from
certain IP addresses?

Thanks
 
K

Kevin Spencer

Yes. It would require some custom server-side programming in ASP, ASP.Net,
or some less fabulous server-side programming technology.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

Mike Mueller

Jann,
Here is a snip from my default.asp page which redirects
machines on my LAN to a page that has no tracking or hit
counter on it.
----------------------------------------------------------------
<%
' redirects work computer away from page with site tracking

dim strIPAddress, strIPAddressShort
strIPAddress = Request.ServerVariables("Remote_Addr")
strIPAddressShort = left (strIPAddress, 7)

if strIPAddressShort = "192.168" then
response.redirect "default2.asp"
End If
%>
----------------------------------------------------------------
HTH,
Mike


Kevin Spencer wrote:
: Yes. It would require some custom server-side programming
: in ASP, ASP.Net, or some less fabulous server-side
: programming technology.
:
:
: :: Hi - is it possible to have an intro page which
:: redirects to page A (and rest of site) for 99% visitors,
:: but which redirects to page B for users from certain IP
:: addresses?
::
:: Thanks
 
C

clintonG

That was helpful Mike but the OP sounds as if a number of IP
addresses need to be blocked. Your code as written will not scale.

The OP should provide additional commentary to confirm, deny
or clarify (what, how and why) and a refined solution may be possible
to provide without a laborious effort that would otherwise require
compensation.
 
M

Mike Mueller

Clinton-
It was meant as a sample.

As you know, the OP did not provide all the info needed. If
it was the same scenario that I am in it would remove up to
64K addresses.

clintonG wrote:
: That was helpful Mike but the OP sounds as if a number of
: IP addresses need to be blocked. Your code as written
: will not scale.
:
: The OP should provide additional commentary to confirm,
: deny
: or clarify (what, how and why) and a refined solution may
: be possible to provide without a laborious effort that
: would otherwise require compensation.
:
:
: message :: Jann,
:: Here is a snip from my default.asp page which
:: redirects machines on my LAN to a page that has no
:: tracking or hit counter on it.
:: ----------------------------------------------------------------
:: <%
:: ' redirects work computer away from page with site
:: tracking
::
:: dim strIPAddress, strIPAddressShort
:: strIPAddress = Request.ServerVariables("Remote_Addr")
:: strIPAddressShort = left (strIPAddress, 7)
::
:: if strIPAddressShort = "192.168" then
:: response.redirect "default2.asp"
:: End If
:: %>
:: ----------------------------------------------------------------
:: HTH,
:: Mike
::
::
:: Kevin Spencer wrote:
::: Yes. It would require some custom server-side
::: programming in ASP, ASP.Net, or some less fabulous
::: server-side programming technology.
:::
:::
::: :::: Hi - is it possible to have an intro page which
:::: redirects to page A (and rest of site) for 99%
:::: visitors, but which redirects to page B for users from
:::: certain IP addresses?
::::
:::: Thanks
 
J

Jeff

Well.. it could block an ip.. sortof... can't you redirect to a page that
says something like "Your access has been denied"?? Based on an ip?
Jeff
 
K

Kevin Spencer

That isn't necessary. IIS can be configured to block any IP address or
Domain Name.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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

Top