Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to replace a url hardcoded in server response.

ashk
Cirrus
Cirrus

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. 

 

2 ACCEPTED SOLUTIONS

boneyard
MVP
MVP

Sounds like you want to use the stream profile, have a look at the K article on it:

https://support.f5.com/csp/article/K39394712

View solution in original post

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.

View solution in original post

4 REPLIES 4

boneyard
MVP
MVP

Sounds like you want to use the stream profile, have a look at the K article on it:

https://support.f5.com/csp/article/K39394712

ashk
Cirrus
Cirrus

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.

ashk
Cirrus
Cirrus

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. 🙂