Hello Matt,
As suggested by Mr Plastic, you can use STREAM profile or use this irule to manage the modification :
N.B: You need to add a STREAM profile to your VS.
when HTTP_REQUEST {
Remove the "Accept-Encoding" header
HTTP::header remove "Accept-Encoding"
Finally change the URI while on its way to server.
HTTP::uri "/directory/mysite[HTTP::uri]"
Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
if { [HTTP::header exists Location] } {
set Location [HTTP::header Location]
if { $Location contains "/directory/mysite"} {
HTTP::header replace Location [string map {"/directory/mysite/" "/"} [HTTP::header Location]]
}
}
Check if response type is text or xml
if { [HTTP::header value Content-Type] contains "text" || [HTTP::header value Content-Type] contains "xml" } {
Replace /directory/mysite/ by /
STREAM::expression [ {@/directory/mysite/@/@} ]
Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
Log each match found by the stream filter
log local0. "Stream filter matched: [STREAM::match]"
}
Hope it helps
Please give us a feedback
Regards