Forum Discussion
pchace
Nimbostratus
Aug 09, 2019Trying to replace the header host value if it doesn't match 2 conditions
I am trying to write an irule that will replace the header host value if it does not meet 1 given value or a 2nd given value. I tried the below irule based on info I gathered from various posts but ...
Vijay_E
Cirrus
Aug 09, 2019Try:
set HOST [string tolower [HTTP::host]]
if { (not ($HOST eq "abc.host.com")) or
(not ($HOST eq "xyz.host.com")) } {- pchaceAug 09, 2019
Nimbostratus
Thanks Vijay,
Let me know if I did something wrong, but I entered the rule like this:
when HTTP_REQUEST {
HOST = [string tolower [HTTP::host]]
if { (not ($HOST eq "abc.host.com")) or
(not ($HOST eq "xyz.host.com")) } {
HTTP::header replace Host "abc.host.com"
}
}
And it gave me this error: 01070151:3: Rule [/Common/rule_header_replace_abc] error: /Common/rule_header_replace_abc:2: error: [undefined procedure: HOST][HOST = [string tolower [HTTP::host]]]
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
