Forum Discussion

amanthin_4026's avatar
amanthin_4026
Icon for Nimbostratus rankNimbostratus
Jul 20, 2012

How can I detect # sign in URI using irule

I'd like to distinguish between the following two URLs

 

 

1) https://host.com/abc/ux/flash.html

 

 

2) https://host.com/abc/ux/flash.htmltab=Home%28page=Home&id=h4rih9ki%28%29%29

 

 

 

 

 

 

The difference between these two URLs is the existence of and some characters.

 

 

 

The set uri [] has the same value for both the above URLs. Is there a different header attribute or something that I can use to detect this ?

 

 

 

 

 

 

 

 

6 Replies

  • Might not be the most graceful solution, but using "contains" works. I threw this onto a dev F5 and tested-- seems to work.

     

     

    if {[HTTP::uri] contains ""} { log local0. "Found " } else { log local0. "No " }

     

     

    You could also just grab everything after the first using the following:

     

    set vars [getfield [HTTP::uri] "" 2]

     

     

    Hope this is atleast somewhat helpful.

     

     

    John
  • is it fragment identifier?

     

     

    i thought it is client-side only i.e. browser does not send it to server (bigip).

     

     

    Fragment identifier wiki

     

    http://en.wikipedia.org/wiki/Fragment_identifier
  • Is it possible for the browser to not send anything after ? i do not see browser sends it in my lab unit. have you seen it? do you have tcpdump?
  • As Nitass said, the user-agent shouldn't include the anchor (or fragment) in its request to the web server--it's just by the server to tell the client how to render the page and/or focus the page once it is loaded.

     

     

    Aaron