Stream Content Rewrite
Hi,
I have a requirement to rewrite some content and mask this from the connecting client. I originally had this working with a re-write profile but couldn't figure out how to do other things in an IRULE with a rewrite profile.
So I have the following IRULE some content needs rewriting '/content/site' which appears to work OK however some content needs to stay as is "/content/preserve/preserve" . So when I load the page the /content/site content appears to be ok however the /content/preserve/preserve doesn't load and not sure why.... my rule is below any help appreciated..
Thanks
Matt
when HTTP_REQUEST { HTTP::path [string tolower [HTTP::path]] if {[string tolower [HTTP::uri]] starts_with "/content/preserve/preserve/"} { continue STREAM::disable } elseif {[string tolower [HTTP::uri]] starts_with "/"} { set uri [string map -nocase {"/" "/content/site/"} [HTTP::uri]] HTTP::uri $uri STREAM::disable HTTP::header remove "Accept-Encoding" } } when HTTP_RESPONSE { STREAM::disable STREAM::expression {@/content/site/@/@}
Enable the stream filter for this response only
STREAM::enable
re-write Location header
HTTP::header replace Location [string map {/content/site/ /} [HTTP::header Location]]
}