Forum Discussion

Peter_Milanese_'s avatar
Peter_Milanese_
Icon for Nimbostratus rankNimbostratus
Jun 30, 2005

HTTP_REFERER?

Greetings-

 

 

Our intranet is partially exposed to the internet. I'd like to be able to do a referer check for our search appliance (and redirect it out if no match). I cannot find anything in the docs supporting the referer variable, hence I cannot run the check. Can anyone advise?

 

 

Thanks-

 

 

Pete
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Pete,

     

     

    You should be able to use the HTTP::header command to find this information. The HTTP::header command will return the value of the specified header field.

     

     

    The syntax looks like:

     

    HTTP::header [value]

     

     

    Or, in your case:

     

    HTTP::header REFERER

     

     

    This should return the value of the REFERER field in the HTTP header.

     

     

    More information on this, and other header and content commands can be found on DevCentral in the Docs & Tips section under Tech Resources.

     

     

    Thanks,

     

    -Colin
  • rapmaster_c_127's avatar
    rapmaster_c_127
    Historic F5 Account
    Posted By unRuleY on 6/30/2005 12:56:47 PM

     

     

    FYI - I think it's actually REFERRER with two R's...

     

     

    No... the authors of RFC2616 couldn't spel to gud. It's Referer, with one "r".
  • Are there situations in which the Referer variable will not get populated?

     

     

    Part of our application setup will redirect users among different virtual servers on the same BIGIP device. I am trying to determine if the user has been redirected from one virtual server to the other, but whenever I try to work the the HTTP::header Referer variable, it never works - outputting this variable to the logs shows that it's just empty.

     

     

    Any suggestions?

     

     

    Thanks.
  • Initial hits would not have a referer, and it is possible in some browsers to configure it not to send referers. All in all, unless you are in a controlled anvironment, using referer as a decision maker may not be as reliable as you'd like. I would not depend on it for public sites. This does not mean that all should be empty though. Are you certain that the configuration on the web server is correct?