Forum Discussion
matt1985_299432
Nimbostratus
Sep 12, 2017Stream 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...
matt1985_299432
Nimbostratus
Sep 12, 2017when 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]]
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
