Forum Discussion

vandit_bhatia_1's avatar
vandit_bhatia_1
Icon for Nimbostratus rankNimbostratus
Jul 03, 2014

IRULE for HTTP HEADER STRING find and replace

Hi All,

 

i need to create an irule on LTM. The following is to be achieved

 

if the HTTP Header is "http://www.abc.com/dig/abc/sty.jsp" i need the LTM to find the multiple entries string for "abc" and replace it with "xyz".

 

Could anybody please help me on this.

 

  • Hi,

    when HTTP_REQUEST {
        if { [string tolower [HTTP::uri]] contains "abc" } {
        set uri [string map -nocase {"abc" "xyz"} [HTTP::uri]]
                HTTP::uri $uri
    }
    }
    
  • Hi,

    when HTTP_REQUEST {
        if { [string tolower [HTTP::uri]] contains "abc" } {
        set uri [string map -nocase {"abc" "xyz"} [HTTP::uri]]
                HTTP::uri $uri
    }
    }