Let's add some logging to the iRule to see what's going on:
when HTTP_REQUEST {
set origURI [HTTP::uri]
set newURI "/irj/portal[HTTP::uri]"
HTTP::uri $newURI
log local0. "Original URI: $origURI"
log local0. "Rewritten URI: $newURI"
}
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "3" } {
set origRedir [HTTP::header Location]
set newRedir [string map {":50100/irj/portal" "" } [HTTP::header Location]]
HTTP::header replace Location $newRedir
log local0. "Original redirect: $origRedir."
log local0. "Rewritten redirect $newRedir"
}
}
Log will write to /var/log/ltm, or Local Traffic log in the GUI. Examine output for clues.
If it doesn't reveal itself, I'd recommend making one change at a time & verifying each is having the desired effect per the descriptions in my previous post, then posting back with any specific challenges you encounter, and we'll take it from there.
HTH
/deb