Forum Discussion
Kai_Wilke
Feb 03, 2016MVP
Hi John,
an ACE action-list of...
action-list type modify
http login
header rewrite request Host header-value "hosta[.]companyA[.]com(.)" replace "host1.companyA.com:64592%1"
header rewrite response Location header-value "https://host1.companyA.com:64592/(.)" replace "https://hosta.companyA.com/%1"
... could be translated to ...
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "hosta.companya.com" } then {
HTTP::header replace Host "host1.companyA.com:64592"
}
}
when HTTP_RESPONSE {
if { [string tolower [HTTP::header value Location]] starts_with "https://host1.companya.com:64592" } then {
HTTP::header replace Location "https://hosta.companyA.com[getfield [HTTP::header value Location] ":64592" 2]"
}
}
Note: I'm using
to make it more robust. So keep an eyee on lower CASE formating for the equals and starts_with comparsions.[string tolower]
Cheers, Kai