Forum Discussion
Rodney_Newton_7
Nimbostratus
Nov 08, 2006Change Host Value
All,
I am trying to do something I thought would be pretty simple but I am missing something... whenever I see a request for www.outsidedomain.com I need to change that to servername. When I see the response I need to flip it the other way. Here is what I tried but maybe I am going about this the wrong way.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.outsidedomain.com" }{
HTTP::header replace host "servername"
log local0. "The header is [HTTP::header host] "
log local0. "The Host Value is [HTTP::host]"
} else {
log local0. "No Changes Made"
}
}
The HTTP::host entry in the log is the same as when it came in but the HTTP::header host is the value I set. I understand that I need a when HTTP_RESPONSE for the return traffic but I can't even get this first part to work. What am I doing wrong? Thanks.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects