17-Dec-2020 12:28
The issue is requests arrive like:
https://www.lor.edu/lorprod/items/ebb81b9e-0e6f-4bd8-af22-bf865212e2cd/1/
and we redirect to:
https://oCCC.edu/ware/lesson/ebb81b9e-0e6f-4bd8-af22-bf865212e2cd/1/
we need to remove the last /1/ if present from each request and the number may not be a "1" and may be a much larger number so that our final redirect looks like:
https://oCCC.edu/ware/lesson/ebb81b9e-0e6f-4bd8-af22-bf865212e2cd
our current iRule reads:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/lorprod/items/" } {
HTTP::redirect "https://occc.edu/courses[string map -nocase {/lorprod/items/ /} [HTTP::uri]]"
}
}
any assistance is greatly appreciated.
17-Dec-2020 13:05
Hi,
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_with "/lorprod/items/" } {
HTTP::redirect "https://occc.edu/ware/lesson/[getfield [HTTP::path] / 4]"
}
}