Forum Discussion
Walter_WorkAcct
Altostratus
Enes Afsin Al, thank you for the response and I do appreciate it but even changing that comparison only works on the default. For example, oldsite.ournewsite.net/foo goes to https://ournewsite.net/oldsitestuff instead of https://ournewsite.net/oldsitestuff/foo
Apr 24, 2021
when HTTP_REQUEST {
log local0. "oldsitelog1 | host = [HTTP::host] | uri = [HTTP::uri] | client_ip = [IP::client_addr]"
if { [HTTP::host] equals "oldsite.ournewsite.net" } {
switch -glob [HTTP::uri] {
"*/foo" {
log local0. "oldsitelog2 foo | uri = [HTTP::uri] | client_ip = [IP::client_addr]"
HTTP::respond 301 Location https://ournewsite.net/oldsitestuff/foo
return
}
"*/bar" {
log local0. "oldsitelog3 bar | uri = [HTTP::uri] | client_ip = [IP::client_addr]"
HTTP::respond 301 Location https://ournewsite.net/oldsitestuff/bar
return
}
default {
log local0. "oldsitelog4 default | uri = [HTTP::uri] | client_ip = [IP::client_addr]"
HTTP::respond 301 Location https://ournewsite.net/oldsitestuff
return
}
}
}
}
Can you investigate ltm logs?
tail -f /var/log/ltm | grep oldsitelog