Forum Discussion

Ted_Smith_11168's avatar
Ted_Smith_11168
Icon for Nimbostratus rankNimbostratus
Jun 12, 2006

Part of URI lost on re-direct command?

Please help me to resolve a problem involving a re-direct command in an i-Rule.

 

 

User accesses url https://aac.alliedinsurance.com/manuals/commerciallines/emanual/Farm/Farm-Manual/In/IN-FMP-rates.pdfglass

 

 

i-rule redirects user to https://aac1.alliedinsurance.com/[HTTP::uri]

 

 

User is redirected to: https://aac1.alliedinsurance.com/manuals/commerciallines/emanual/Farm/Farm-Manual/In/IN-FMP-rates.pdf

 

 

Notice the glass is missing. I am told this is an anchor to be found within the PDF file. My question does the f5 loadbalancer not consider the glass as part of the uri variable? If so, is there a way to preserve the glass portion of the url so it is not lost?

 

 

In general I am redirecting any traffic for aac.alliedinsurance.com to aac2.alliedinsurance.com and setting a cookie.

 

 

Here is my active iRule:

 

when CLIENT_ACCEPTED {

 

set ckname aac2

 

set ckvalue [IP::client_addr]

 

set ckdomain .alliedinsurance.com

 

set cookie [format "%s=%s; path=/; domain=%s" $ckname $ckvalue $ckdomain]

 

}

 

when HTTP_REQUEST {

 

HTTP::respond 302 Location "https://aac2.alliedinsurance.com[HTTP::uri]" "Set-Cookie" $cookie

 

}

 

 

Thanks for your help,

 

-Ted
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Interesting...

     

     

    I thought the HTTP::uri variable would contain this information. You might try logging both the HTTP::uri info as well as the [HTTP::header location] (which would have to be in the HTTP_RESPONSE event) info to see what their values are.

     

     

    If the uri variable isn't working, perhaps grabbing the location value sent back from the server and stripping off the hostname portion would get you the complete uri you need. You could then use it to create the new location for your HTTP::respond.

     

     

    Colin