Forum Discussion
Help with i-rule
Hi Can someone please help me with a i-rule requirement? Requirement: The default url https://www.abc.com goes to it defualt server pool. but If the uri is /helloworld then it goes to a different server pool. My i-rule below does not seem to working correctly. All the requests are going to HelloWorld pool.
when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] switch -glob $uri { "/HelloWorld" { pool pool_www.abc.com_HelloWorld } “” { pool pool_www.abc.com_default.
}
} }
- Stanislas_Piro2
Cumulonimbus
use this code:
when HTTP_REQUEST { if {[string tolower [HTTP::uri]] starts_with "/helloworld"} { pool pool_www.abc.com_HelloWorld } else{ pool pool_www.abc.com_default } }
when you use $1, it means you convert the uri to lowercase... if you compare to /HelloWorld, it will always fail because it contains uppercase.
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