Forum Discussion
eLeCtRoN
Cirrus
Aug 22, 2018iRule HOST Header replace with dynamic content
Hello,
I have just a short question, is it possible and how to change the HOST Header.
For example I come from admin.test1.mycompany.com and I would like to change it
to admin.test2.mycompany.co...
Lee_Sutcliffe
Nacreous
Aug 22, 2018This is an amended version, if there is only a first name (second field is "test1") then is will only add the first name. If not, it will add the first two fields to the new host header.
when HTTP_REQUEST {
set field1 [getfield [HTTP::host] “.” 1]
set field2 [getfield [HTTP::host] “.” 2]
if {$field2 eq "test1"} {
HTTP::header replace "Host" ${hostField}.test2.mycompany.com
} else {
HTTP::header replace "Host" ${field1}.${field2}.test2.mycompany.com
}
}
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