_Mo__2
Dec 13, 2018Nimbostratus
Exception in a Stream:expression rewrite in iRule
Hi everyone,
Need your help on how make an exception in the payload of the page when I want to rewrite links from http:// to https://.
I would like to rewrite http://www.example.com in https://www.example.com except 1 link needed for auth on the backend.
The link I don't want to rewrite is:
I added in my iRule the famous irule found here:
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
LTM does not uncompress response content, so if the server has compression enabled
and it cannot be disabled on the server, we can prevent the server from
sending a compressed response by removing the compression offerings from the client
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
Check if response type is text
Replace http:// with https://
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@http://www.example.com@https://www.example.com@ @http%3a%2f%2fwww.example.com@https%3a%2f%2fwww.example.com@}
Enable the stream filter for this response only
STREAM::enable
}
}
Problem, it rewrote all link but also those for the authentication.
Do you have any idea to make an exception for this link only ?
Thanks a lot.
Mo