Samir_Jha_52506
Oct 15, 2015Noctilucent
URL Redirection request.
Hi All,
I wanted to write irule with help of "Class-object" but need your help to grep ID value (SAV603,SAV644, SAV651,etc) in URI. SO that based on object i can forward request to respective direction.
Redirect the request to http://go.pqr.com/elib for below urls & rest will work as usual.
http://uattest-XYZ.com/bin/enterprise?siteName=a&No=SAV603 https://uattest-XYZ.com/bin/enterprise?siteName=a&No=SAV644 http://uattest-XYZ.com/bin/enterprise?siteName=a&No=SAV651
I have written irule with help of Switch but in future if user wanted to redirect more URL, Class option will be more helpful. So i wanted to redirect URL based on ID((SAV603,SAV644, SAV651,etc)
Switch Irule when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/bin/enterprise?siteName=a&No=SAV603" -
"/bin/enterprise?siteName=a&No=DP6012" -
"/bin/enterprise?siteName=a&No=SA1005" { HTTP::redirect "http://go.pqr.com/elib" }
default {}
}
}