Forum Discussion

Ben_Novak's avatar
Ben_Novak
Icon for Employee rankEmployee
May 11, 2009

http url append

Similar to the /owa append for outlook anywhere, I would like to append a url when somebody access one of our load balanced websites. Basically when somebody types in http://butters it will append /psp/CRPROD/?cmd=login&languageCd=ENG& to the end of it, making it http://butters/psp/CRPROD/?cmd=login&languageCd=ENG&. I tried to modify the iRule for the owa append but I only get the last half of the url, everything after /psp/CRPROD/. I think it has to do with the slashes. Can someone send me in the right direction or help me out? Thanks.

 

 

******original OWA append rule from documentation*****

 

when HTTP_REQUEST {

 

if { not ([HTTP::uri] starts_with "/owa") } {

 

HTTP::uri /owa[HTTP::uri]

 

}

 

}

 

 

******This is what I have so far******

 

}

 

when HTTP_REQUEST {

 

if { not ([HTTP::uri] starts_with "/psp/CRPROD/?cmd=login&languageCd=ENG") } {

 

HTTP::uri /psp/CRPROD/?cmd=login&languageCd=ENG[HTTP::uri]

 

}

 

}

2 Replies

  • Your logic seems sound.

    How about writing in the following:

     
     when HTTP_REQUEST { 
        if { [HTTP::uri] eq "/") } { 
            HTTP::uri /psp/CRPROD/?cmd=login&languageCd=ENG[HTTP::uri] 
           } 
     } 
     

    This is assuming someone had entered "http:://butters/" to make the condition true and append the URI with a trailing "/". If they entered "http://butters/creme" it would not append

    Hope this helps

    CB

  • That is exactly what I was looking for. Works great. Thank you very much!