Forum Discussion

ashk's avatar
ashk
Icon for Cirrus rankCirrus
Oct 14, 2022

How to replace a url hardcoded in server response.

Hello Everyone, 

 

I have public server website and when we click on a "ClickHere" button it will redirecting to "https://brokensorry.com". 

Server Team unable to alter the hardcoded url on the server and wanted to change the response on F5 with url "https://goodok.com". 

"https://brokensorry.com" = "https://goodok.com"

I see its not the header or host to replace, its in the post/response from the server in json or metadata. 

Could someone help with the iRule to replace the content in metagata or post js file when presenting to client. 

 

  • the article says:

    • When you configure the virtual server with the HTTP profile, the Stream profile performs only the search and replace procedure on the HTTP payload. This applies to both client requests and server responses.

    that means not only headers, but also the body.

  • thank You so much for your quick reply. 

    It worked. I added a new profile (Local Traffic / Profiles / Other / Stream) and inserted source and target and attached it to VirtualServer. 

    I see the redirection happens. 

     

    Thanks in tons. 🙂 

  • I see the article is similar but it talks about the header replacement. 

    The text I want to replace is in the body returned by server to client in html metadata. 

     

    Could you please help me with the same if anything? 

    • the article says:

      • When you configure the virtual server with the HTTP profile, the Stream profile performs only the search and replace procedure on the HTTP payload. This applies to both client requests and server responses.

      that means not only headers, but also the body.