Forum Discussion
Mar 07, 2014
Maybe something like this?
when HTTP_REQUEST {
set state [getfield [string tolower [HTTP::path]] "/" 2]
if { [class match $state equals states] } {
HTTP::respond 301 location "http://abc.com/$state"
}
}
Create a string data grouplist with all the states (lowercase strings) to match them.
Or if ALL your request is http://xyz.com/[state], then you don't need the data group:
when HTTP_REQUEST {
set state [getfield [string tolower [HTTP::path]] "/" 2]
HTTP::respond 301 location "http://abc.com/$state"
}
Beware of multiple redirects if you have other iRule content executed afterwards.
Good luck!
/Patrik