Forum Discussion
arripay_6298
Nimbostratus
Jun 28, 2016Redirect Problem
Hi,
using a single and pool with multiple hosts, trying to do a redirect based on host name and uri match using the following.
when HTTP_REQUEST {
log local0. "Request: [HTTP::host][HTTP::ur...
Vijay_E
Cirrus
Jun 28, 2016I would recommend using datagroup with "class match" instead of "matchclass" as this has been deprecated with the 10.x code version and later.
Try this:
when HTTP_REQUEST {
log local0. "Request: [HTTP::host][HTTP::uri]"
if {[HTTP::host] equals "website1.com"} {
if { ([HTTP::uri] contains "app/commission") or ([HTTP::uri] contains "api/tickets") or ([HTTP::uri] contains "api/manageclasses") or ([HTTP::uri] contains "app/trainer") or ([HTTP::uri] contains "app/target") } {
HTTP::respond 301 Location "http://www.website2.com/"
}
}
}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