Forum Discussion
Redirect URL
- Oct 30, 2015
I had a similar situation. What i did was: * create a pool with no active members * create a VS and assign this pool to it * create an irule which looked at the of active members in the pool and if is 0 then redirect to external URL The irule is as below:
when HTTP_REQUEST { if { [active_members TS-EmptyPool] == 0 }{ HTTP::redirect "https://www.surveymonkey.com/s/eg.survey" } }
karthik
Assuming the virtual only hosts a single domain
when HTTP_REQUEST {
if {[string tolower [HTTP::path]] eq "/examplepage.html"} {
HTTP::respond 301 noserver Location "http://www.externalsite.com/"
return
}
}
Otherwise if www.examplesite.com is a vhost on the virtual try this;-
when HTTP_REQUEST {
if {[string tolower [HTTP::path]] eq "/examplepage.html" && [getfield [HTTP::host] : 1] eq "www.examplesite.com"} {
HTTP::respond 301 noserver Location "http://www.externalsite.com/"
return
}
}
Now as to what's best/easiest....it's a matter of personal taste really. For me an iRule is easiest, however in theory a Local Traffic Policy or Rewrite Service is more efficient. Try them all and see what suits you....
Let me know if the iRule doesn't work for you.....
- Tyron_Fourie_18Oct 30, 2015CirrusHi, Either doesn't work for me. The same page just loads.
Recent Discussions
Related Content
* 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