24-Feb-2021 13:43
Hi,
i have the below irule
When HTTP_REQUEST {
if { [HTTP::host] equals " www.abc.com"
switch -glob [HTTP::path]
{ "/App/Events/Calendar.aspx"
{HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" }
}
{ "/App/events/Calendar.aspx"
{HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" }
}
{ "/app/Events/Calendar.aspx"
{HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" }
}
My question is how to make this irule simple, can i use string tolower for this case? and how do i apply it to this irule.
Thanks in advance.
Solved! Go to Solution.
26-Feb-2021
06:46
- last edited on
24-Mar-2022
01:24
by
li-migration
Glad could be of help, would you mind marking the solution as answer provided, so it can help others too.
25-Feb-2021
03:26
- last edited on
04-Jun-2023
21:02
by
JimmyPackets
Yes you can use string to lower,
when HTTP_REQUEST {
if { [HTTP::host] equals "www.abc.com" } {
switch -glob [string tolower [HTTP::path]] {
"/app/events/calendar.aspx" {
HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx"
}
default {
pool default_pool
}
}
}
}
26-Feb-2021
04:12
- last edited on
24-Mar-2022
01:24
by
li-migration
- Were you able to test this.
26-Feb-2021 06:14
i just completed all my test cases after applying this new irule. it works, thanks a lot for your support.
26-Feb-2021
06:46
- last edited on
24-Mar-2022
01:24
by
li-migration
Glad could be of help, would you mind marking the solution as answer provided, so it can help others too.
26-Feb-2021 06:53
How do I mark the solutions as answer provided? I would like to do it.