Forum Discussion
Samir_Jha_52506
Noctilucent
Oct 15, 2015URL 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 direc...
Arie
Altostratus
Nov 05, 2015To use a class:
if { ([class match [string tolower [HTTP::query]] contains class_NoQueryStringValuesToRedirect]) } {
HTTP::response 301 Location "http://go.pqr.com/elib"
}
The values in the class would be as follows (lower case!):
no=sav603
no=dp6012
[...]
You could get more fancy and extract the value instead of comparing to the name+value, but that's probably not necessary here.
Also, note that I used a 301 instead of a 302. The benefit is that it gets cached by clients (saving requests). However, if the destination is likely to change you'll want to use a 302 (which is what
HTTP::redirect generates).Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects