Forum Discussion
iRule or Re-write Profile
Yes, you can try following rule.
when HTTP_REQUEST {
if { [IP::client_addr] eq "x.x.x.x" } {
pool pool_A
}
HTTP::header replace "Host" "host1.com"
}
when HTTP_RESPONSE {
if { [HTTP::header exists "Location"] } {
set location [HTTP::header "Location"]
set updated_location [string map {"host1.com" "example.com"} $location]
HTTP::header replace "Location" $updated_location
}
# Optional: content replacement if backend returns HTML with embedded URLs
if { [HTTP::header "Content-Type"] contains "text/html" } {
STREAM::enable
}
}
when STREAM_MATCHED {
STREAM::replace "host1.com" "example.com"
}
when HTTP_RESPONSE_DATA {
# Needed for stream profile
}
please try above irule.
Recent Discussions
Related Content
* 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