Forum Discussion
John_Stevensen
Nimbostratus
Sep 20, 2017IF http::host NOTEQUALS? Whats the correct way to do this?
I apologize but the formatting is not showing properly.
Im trying to find the "right way" to write this iRule - but I cannot confirm there is a "not equal" that exists....
when HTTP_REQUEST {
...
Chris_Grant
Employee
Sep 20, 2017This might help: https://devcentral.f5.com/articles/irules-101-02-if-and-expressions
Normally you'd use a ! to negate a match, so
when HTTP_REQUEST {
if { ([HTTP::host] != "orders.widgets.com") } {
HTTP::redirect "https://orders.widgets.com/redirectpage.html"
}
}
Don't forget to use string tolower before you try to match.
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