supportrsd_1762
Jan 15, 2015Nimbostratus
Rewrite
Hello I need to rewrite a url for a webapplication (that is accsed with a apm portal) from a absolute url to relative url (for a couple of reason there is no way of changing it in the code that generates the url)
So the full url looks like this: https://hejhej.hej.com/HFS/index.php?action
and i want to strip the https://hejhej.hej.com/HFS/
The irule looks like this, but i cant get it to work, it dont seems to find the urls, since they are left untouched
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "f5-w-6874000033a2f2f73736c76706e2e6668732e7365$$" } {
Remove the Accept-Encoding header so that the server will not compress the response
(otherwise the stream rewriter won't work, since it doesn't decompress the stream)
HTTP::header remove "Accept-Encoding"
log local0. " Match"
Set a variable so we know to do custom stream rewrite
set strReplace 1
Disable the default stream profile so we can modify it on response
STREAM::disable
}
}
when HTTP_RESPONSE {
if { [info exists strReplace] && $strReplace && [HTTP::header "Content-Type"] contains "html" } {
STREAM::expression {@