?
Solved

referrer information in IIS

Posted on 1998-11-03
6
Medium Priority
?
1,208 Views
Last Modified: 2013-12-25
Does anyone know how to get the referrer information using asp and IIS?
0
Comment
Question by:1stomni
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1856075
<%
Response.write Request.ServerVariables("HTTP_REFERER")
%>

0
 

Author Comment

by:1stomni
ID: 1856076
We have tried this already.  We printed all of the server variables and referer does not show up.  Do we need to set something in IIS to get this information.  Also, what browsers support this?
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856077
The Referer works in IE and NS for sure.  I have tested in IE 3.x and up and NS 3.x and up.  Also, to use the referer, you must be coming from a site.  You cannot just type in an address.  Also, make sure you spelled it correctly.  It is with one "r" not two.


0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1856078
MasseyM: IE 3.01 and lower does as far as I know not pass the referrer.

In most browsers the referrer is not set when the page with the link is loaded from harddisk or from the location bar. NS 2.0 also passes the referrer.

Michel
0
 
LVL 28

Accepted Solution

by:
sybe earned 200 total points
ID: 1856079
HTTP_REFERER is independent of the browser, it is part of the http-protocol.
MasseyM is right to tell you must come from a site to see it. If there is no referer, the value of HTTP_REFERER is empty.
But it exists nonetheless, as you can see in this ASP-code:

<TABLE BORDER=1 WIDTH=100%>
<TR>
  <TH COLSPAN=2> HTTP / Server Variables</TH>
</TR>
<TR>
  <TD><B>Server Variable</B></TD>
  <TD><B>Value</B></TD>
</TR>
  <% For Each name In Request.ServerVariables %>
<TR>
  <TD> <%= name %> </TD>
  <TD> <%= Request.ServerVariables(name) %> </TD>
</TR>
<% Next %>
</TABLE>




The referer that Michel talks about is the value of the referer in the client (which can be called with javascript). IE3 has a bug in the document.referrer (javascript uses double "r"), which gives it the same value as document.location. In fact you can recognize IE3 by this:

<script>
if (document.referrer == document.location) {
  alert("this browser is MSIE3");
}
</script>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1856080
Sybe: I might have mixed it up with the stats sites that cannot do referer stats on IE3

I thought the browser did not send it (it IS http client dependant however)

It must be because they use JavaScript to send the referer along to the stats program... now why couldn't they just use the http-referer if what you say is true?

Michel
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question