Forum Discussion
Tim_Cahoon_1608
Nimbostratus
Dec 05, 2016If incomming URL does not have specific URI's then redirect to external website
For this application, if an HTTP request doesn't come in with certain specific URI's then we want to redirect it to this Content Management front end in the cloud. I tried doing it this way:
wh...
Vijay_E
Cirrus
Dec 05, 2016When posting iRule, please use formatting for ease of reading. This is your iRule:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/fmstorefront"} {
pool qa.fmmpe-cat.com_80
} elseif { [HTTP::uri] starts_with "/medias"} {
pool qa.fmmpe-cat.com_80
} elseif { [HTTP::uri] starts_with "/fmwebservice"} {
pool qa.fmmpe-cat.com_80
} elseif { [HTTP::uri] starts_with "/ipows"} {
pool qa.fmmpe-cat.com_80
} else {
HTTP::redirect "https://d2ipxxe5h4s25e.cloudfront.net"
}
}
I would recommend using a datagroup like this as there is a common pool for the matches URI:
when HTTP_REQUEST {
if { [class match [HTTP::uri] starts_with CLASS_URI] } {
pool qa.fmmpe-cat.com_80
} else {
HTTP::redirect "https://d2ipxxe5h4s25e.cloudfront.net"
}
}
CLASS_URI is a datagroup.
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