Forum Discussion
irule usi else statement
so I need help with an I rule saying. If the url is https://imortgages.com or https://imortgages.mysite.local then ok just continue to default webpage. Else if any agent names /uri exits after url like https://imortgages.come/bill or https://imortgages.mysite.local/sue send it as a redirect to server 10.20.30.40 (node not defined in ltm but could if needed) for processing. I currently have an irule and a data group with all the agents or I can send the /uri to the server 10.20.30.40. ! ! when HTTP_REQUEST { if (only main /host then show default page from default pool member) This is working ) If any /uri then send entire header to server 10.20.30.40 as a redirect. (or if better option proccess data group below) else [class match [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } { HTTP::redirect [class match -value [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } } }
2 Replies
- Kevin_Stewart
Employee
Perhaps something like this?
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { return } else { if { [class match [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } { HTTP::redirect [class match -value [string tolower [HTTP::uri]] starts_with Mortgage_iRuler] } else { node 10.20.30.40 80 } } } - Gill_32697
Nimbostratus
Yes, that is working a lot better. I'll tweak it a little more. Thanks again.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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