Now I'm onto replacing all instances of /oldFolder/ with /newFolder/ in the page content, does this look right?
when HTTP_REQUEST {
switch -glob [ string tolower [HTTP::uri] ] {
"/newFolder/*" {
HTTP::uri [ string map {"newFolder" "oldFolder"} [HTTP::uri] ]
set urlRewrite 1
}
}
}
when HTTP_RESPONSE_DATA {
rewrite the franchise number back to the name in server response
if { $urlRewrite == 1 } {
regsub -all "/Find" [HTTP::payload] "/ReplaceWith" newdata
regsub -all "/368" [HTTP::payload] "/515" newdata
set clen [HTTP::payload length]
HTTP::payload replace 0 $clen $newdata
HTTP::release
}
}