Forum Discussion
JimT02
Aug 28, 2016Nimbostratus
how can i rewrite meta refresh url on response
i have the following code for a response:
' '
i am trying to rewrite (via irule, stream) the ip address (xxx.xxx.xxx.xxx) to a FQDN host name url.
my normal http_response irule does ...
Kai_Wilke
Aug 28, 2016MVP
Hi Jim,
you may take a look to the STREAM code example below...
when HTTP_REQUEST {
Disable STREAM for HTTP_REQUESTs
STREAM::disable
Remove the "Accept-Encoding" header to see cleartext data on the responses.
Note: You could also use a HTTP-Compression Profile to remove the
Accept-Encoding header on the server side
(Profile Option: Keep Accept Encoding = Disabled).
By doing this, you can STREAM the content without losing
the ability to support a client side compression.
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
Rechunk any Chunked Responses to become able to STREAM those content, without braking the Application.
if {[HTTP::header exists "Transfer-Encoding"]} {
HTTP::payload rechunk
}
Apply STREAM expression just to Content-Type = text
if {[HTTP::header value "Content-Type"] contains "text"}{
Set the STREAM expression
STREAM::expression {@https://1.1.1.1/@https://host.domain.tld/@}
Enable STREAM of the current response
STREAM::enable
}
}
Note: If this code does not translate the string https://1.1.1.1/ to https://host.domain.tld/, then you may take a look to the response headers and the HTML content and post them here. It could be either that the "Content-Type" value is different or that the tag is somehow URL encoded..
Cheers, Kai
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects