Forum Discussion
monica_74227
Oct 28, 2009Nimbostratus
how to do HTTP header replace with iRule
Hey guys,
well, the client wants to use special string to replace the http response header's host string. could you help me to check the following iRule or correct it
when HTTP_RESPONSE {
set newhost "www.xyz.com"
if { [HTTP::header host] eq "www.abc.com" } {
HTTP::header replace host $newhost }
}
thanks!
- hooleylistCirrostratusThere is no Host header in HTTP responses. What is the customer trying to achieve? Do they want to change the hostname displayed in the browser address bar? If so, you'd want to send the client an HTTP redirect instead of rewriting a header in the response. Other possibilities are:
when HTTP_REQUEST { if { [HTTP::header host] eq "www.abc.com" } { HTTP::header replace Host "www.xyz.com" } }
- monica_74227NimbostratusHey Aaron,
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