Forum Discussion
Girish_HS_32793
Nimbostratus
Aug 05, 2008Help: Redirect to https with URI
Hi Team,
I have a iRule setup for http which checks for URI and assigns the Node & port to be used.
when HTTP_REQUEST {
if { [HTTP::host] equals "mysite.someplace.com"} {
if { [HTTP::uri] starts_with "/abc" } {
node 10.244.8.34 9001
}
}
}
Now I need to redirect http://mysite.someplace.com to https://mysite.someplace.com, check for URI and use specific node and port.
How do I achieve this?
- hoolio
Cirrostratus
Checking the URI and using a specific IP and port is what the rule you posted does. Can you clarify what you're trying to accomplish? - Girish_HS_32793
Nimbostratus
Hi Aaron, I will try to explain what I need to accomplish. - hoolio
Cirrostratus
Hi Giri,when HTTP_REQUEST { Check requested hostname switch [string tolower [HTTP::host]] { "order.asia.com" { if {[HTTP::uri] starts_with "/homepage_asia"}{ log local0. "[IP::client_addr]:[TCP::client_port]: Matched order.asia.com/hompage_asia. \ Redirecting to https://order.asia.com[HTTP::uri]" HTTP::redirect "https://order.asia.com[HTTP::uri]" } else { log local0. "[IP::client_addr]:[TCP::client_port]: Matched order.asia.com. Using pool http_pool" pool $http_pool } } "order.aus.com" { log local0. "[IP::client_addr]:[TCP::client_port]: Matched order.aus.com. Redirecting to https://order.aus.com[HTTP::uri]" HTTP::redirect "https://order.aus.com[HTTP::uri]" } default { log local0. "[IP::client_addr]:[TCP::client_port]: Hit default clause." HTTP::redirect "https://default.asia.com[HTTP::uri]" } } }
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