Forum Discussion
Anush
Nimbostratus
Mar 17, 2016redirect site using irule
Hi Expert,
We have one requirement from out client but I am not sure whether it is even possible or not. looking for your help on this.
Sample requirement :
https://abc.com/sites/Port...
VernonWells
Employee
Mar 17, 2016Can do it this way (not tested, but should work):
when HTTP_REQUEST {
set sd [findstr [HTTP::query] "sd=" 0 "&"]
set dd [findstr [HTTP::query] "dd=" 0 "&"]
if { $sd ne "" && $dd ne "" } {
HTTP::redirect "https://xyz.com/generaltechnical?reqtype=GeneralTech&rt=myPC&$sd&$dd"
}
}
Notice that I don't constrain this conditional; that is, I assume you want to redirect any URI that has sd and dd query parameters. If you want to limit it further, that is simple: just add an
if conditional around the entire block that checks for what you need (e.g., HTTP host header, uri-path).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