HTTP_REFERER hangs

B

Brett

rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" & Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if




If I put the redirect back in, it hangs and times out. Otherwise, works fine.

What am I doing wrong?

Thanks,
Brett
 
A

Aaron Bertrand [MVP]

Can't reproduce; need more information.

Have you tried using the same code in a different page? On a different
server? From different referrers? Using a different redirect URL?

Have you tried response.write instead of response.redirect, and paste the
displayed URL in the browser directly?

Have you tried using server.transfer, or sending the URL to client-side
script to perform the redirect? Have you considered using the client-side
window.history.go(-1); method (not sure of the exact syntax, I think that's
close)?

You need to help us narrow down which variables are factors and which are
not...
 
E

Evertjan.

Brett wrote on 21 mei 2004 in microsoft.public.inetserver.asp.general:
rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2
end if

If I put the redirect back in, it hangs and times out. Otherwise,
works fine.

Try this for debugging, and you will probably see that the redirect is to
an illegal string:

rf=Request.ServerVariables("HTTP_REFERER")

sv2=Request.ServerVariables("URL") & "?" &_
Request.ServerVariables("QUERY_STRING")

if instr(rf,"http://www.westcoast") = 1 then
'response.redirect "http://midvalleyfurniture.com" & sv2

''''''''''''''''
response.write "http://midvalleyfurniture.com" & sv2
response.end
''''''''''''''

end if
 
B

Brett

The redirect works fine, if only going to midvalleyfurniture.com. It
hangs when I add the url/query string. I've tried response.writing it
to a link and the url works perfectly, just fails on redirect.

What is server.transfer?

Thanks,
Brett
 
B

Brett

Solved it. It was redirecting to pages with the same code to grab the
referrer. Since it was a redirect, there was no referrer, and it hung,
so I just passed another var to make sure the referrer code didn't run
a second time.


Brett
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top