Forum Discussion
Keith_Richards_
Nimbostratus
Jun 22, 2008switch for redirects
I am trying to redirect some URIs, and direct others to a pool. The following rule will not issue an HTTP redirect (TMOS 9.4.4)
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri] ] {
"/app1*" { HTTP::redirect "https://www.company.com/PRODapp1" }
"/app2*" { HTTP::redirect "https://www.company.com/COMPANY/" }
"/app3*" { pool pool_app3 }
"/COMPANY*" { pool pool_COMPANY }
"/*" { pool pool_COMPANY }
}
Any thoughts on what I'm getting wrong?
- hoolio
Cirrostratus
Hey Keith,when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri] ] { "/app1*" { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] matched /app1" HTTP::redirect "https://www.company.com/PRODapp1" } "/app2*" { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] matched /app2" HTTP::redirect "https://www.company.com/COMPANY/" } "/app3*" { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] matched /app3" pool pool_app3 } "/company*" { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] matched /company" pool pool_COMPANY } default { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] matched default" pool pool_COMPANY } } }
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