ASP and Router

G

George Hester

I used to be able to change the page presented to the client with this code:

<% If Request.ServerVariables("HTTP_HOST") =
Request.ServerVariables("LOCAL_ADDR") Then %>

But now that the site is behind a Router this doesn't work anymore. Because
when Request.ServerVariables("HTTP_HOST") is an IP Address (which is what I
was trying to catch) the Request.ServerVariables("LOCAL_ADDR") is now the
assigned IP Address from the Router and so the test is no longer valid.
Ugh!. Any other way to use ASP to achieve in some some other way what I was
trying to accomplish here? Namely accessing the site by IP Address satisfies
the initial condition? Thanks.
 
A

Anthony Jones

George Hester said:
I used to be able to change the page presented to the client with this code:

<% If Request.ServerVariables("HTTP_HOST") =
Request.ServerVariables("LOCAL_ADDR") Then %>

But now that the site is behind a Router this doesn't work anymore. Because
when Request.ServerVariables("HTTP_HOST") is an IP Address (which is what I
was trying to catch) the Request.ServerVariables("LOCAL_ADDR") is now the
assigned IP Address from the Router and so the test is no longer valid.
Ugh!. Any other way to use ASP to achieve in some some other way what I was
trying to accomplish here? Namely accessing the site by IP Address satisfies
the initial condition? Thanks.

Isn't the fact that HTTP_HOST is numerical enough?
Test it with the RegExp "[^0-9.:]"

Anthony.
 
G

George Hester

thank you Anthony that's right just never used RegExp before. Well I will
now. Again thanks.

--

George Hester
_________________________________
Anthony Jones said:
George Hester said:
I used to be able to change the page presented to the client with this code:

<% If Request.ServerVariables("HTTP_HOST") =
Request.ServerVariables("LOCAL_ADDR") Then %>

But now that the site is behind a Router this doesn't work anymore. Because
when Request.ServerVariables("HTTP_HOST") is an IP Address (which is
what
I
was trying to catch) the Request.ServerVariables("LOCAL_ADDR") is now the
assigned IP Address from the Router and so the test is no longer valid.
Ugh!. Any other way to use ASP to achieve in some some other way what I was
trying to accomplish here? Namely accessing the site by IP Address satisfies
the initial condition? Thanks.

Isn't the fact that HTTP_HOST is numerical enough?
Test it with the RegExp "[^0-9.:]"

Anthony.
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top