Forum Discussion
Aug 02, 2021
Do the urls start with "/morning", "/afternoon", "/night", "/school", "/leadership" or are they exactly equals?
when HTTP_REQUEST {
if { [HTTP::host] equals "abc.com" } {
switch -glob [string tolower [HTTP::uri]] {
"/morning*" -
"/afternoon*" -
"/night*" -
"/school*" -
"/leadership*" {
log local0. "not redirect - uri: [HTTP::uri]"
}
default {
log local0. "redirect - uri: [HTTP::uri]"
HTTP::redirect https://xyz.com[HTTP::uri]
return
}
}
}
}
Can you investigate the ltm logs?
- iRuleAug 02, 2021Cirrus
The URLs are exactly same. So I am still using the first iRule, which you provided. Any idea how we can fix it. I am searching LTM logs in GUI by filtering logs with VS name but no logs are appearing.
- Aug 02, 2021
when HTTP_REQUEST { log local0. "vs: [virtual name] uri: [HTTP::uri] host: [HTTP::host]" if { [HTTP::host] equals "abc.com" } { switch [string tolower [HTTP::uri]] { "/morning" - "/afternoon" - "/night" - "/school" - "/leadership" { log local0. "not redirect - vs: [virtual name] uri: [HTTP::uri]" } default { log local0. "redirect - vs: [virtual name] uri: [HTTP::uri]" HTTP::redirect https://xyz.com[HTTP::uri] return } } } }
You can use the following command to filtering.
tail -f /var/log/ltm | grep irulename
- iRuleAug 03, 2021Cirrus
I typed below command in BIG-IP CLI and started the transaction in the browser i.e https://abc.com/morning but it got redirect to to https://xyz.com. In the CLI no any output of logs is generated.
tail -f /var/log/ltm | grep test_dev