Angelo
Aug 08, 2012Nimbostratus
rewrite body of web-site
Hi is it possible to write body of a web-site where the code says http i need to change it to https. can anyone assist...
It is absolutley possible.
You can do this using the base LTM Functionality within a Stream Profile or a combination of a blank stream profile and an iRule using the STREAM::expression command.
Stream Profile
Local Traffic -> Profiles -> Other -> Stream
- Parent Profile: stream
- Source: http
- Target: https
Stream Expression
Go to the location above and create a "blank" stream profile
- Parent Profile: stream
- Source: leave.blank
- Target: leave.blank
Apply the blank stream profile to the Virtual Server and then apply the iRule example on the STREAM::expression Wiki Page.
Example which replaces http:// with https:// in response content
Prevents server compression in responses
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
if {[HTTP::header value Content-Type] contains "text"}{
Replace http:// with https://
STREAM::expression {@http://@https://@}
Enable the stream filter for this response only
STREAM::enable
}
}
Hope this helps.