IIS 7 and Above
The Request.ServerVariables("HTTP_REFERER") is not working in the Int...
Last post Feb 01, 2012 11:16 AM by HCamper
Feb 01, 2012 03:59 AM|PraveenKumarReddyChinta|LINK
The Request.ServerVariables("HTTP_REFERER") is not working in the Internet Explorer.
We have a requirement like, there are two different websites say, www.example1.com and www.example2.com. I have to redirect all the users who uses www.example1.com to www.example2.com, and when we intentionally select www.example1.com in the dropdown list
of www.example2.com it should have to open without any redirection.
For this I have used Request.ServerVariables("HTTP_REFERER") in the www.example1.com so that I can Identify who are requesting www.example1.com based on that I applied redirection. This worked great in All standard browsers like Mozilla and Google Chrome
but not applying for Internet Explorer.
I used the below ASP code for www.example1.com
<%if(Request.ServerVariables("HTTP_REFERER") <> "http://www.example2.org/") then
URL = "http://api.ipinfodb.com/v3/ip-country/?key=c184c2d089c7763a81d7701a662b57fe3bf90dbfd8bf60d29948878531e24472&ip=" & Request.ServerVariables("REMOTE_ADDR")
Set conn = Server.CreateObject("MSXML2.ServerXMLHTTP")
conn.open "GET", URL, False, "", ""
UserCountry = conn.ResponseText
conArray = Split(UserCountry, ";")
if ((conArray(3) = "US")) Then
It worked fine in all Browsers except IE. Can any one know regarding
this? would you please suggest me the equivalent code for ALL BROWSERS
(Including IE) which would give similar results as mentioned.
Feb 01, 2012 11:16 AM|HCamper|LINK
Get Fiddler2 http://fiddler2.com/fiddler2/ you can use the addons
Lots http://fiddler2.com/Fiddler/help/ of choices for browsers for
I hope fiddler2 worked for your tasks let me know.
Feel free to ask more questions.