Forum Discussion

Ken_Chan_95250's avatar
Ken_Chan_95250
Icon for Nimbostratus rankNimbostratus
Feb 17, 2006

change of HTTP response content

If it is possible to change the HTTP content with irule ?

 

i.e. if the return html file contains some link like http://domain1/image1.jpg, can i change it to http://domain2/image2.jpg ?

 

if yes, which command I should use ? thx ..

 

 

Many thx..

 

 

Ken
  • Option 1: use the stream profile (if available to you). In there you specify a search and replace string and it'll take care of everything for you without an iRule.

     

     

    Option 2: Use the builtin TCL regsub command to perform pattern substitution and then use the "HTTP::payload replace" command in the HTTP_RESPONSE event to replace the existing payload with your modified version.

     

     

    Search the forums and you should find examples of each of these options.

     

     

    -Joe
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    As an addendum to Joe's second solution, which is correct...there is an example of this in the Docs & Tips section under the iRules Tech Tips - Click here

     

     

    -Colin