Forum Discussion
Valentine_96813
Nimbostratus
Nov 07, 2012Redirect on host and uri
Having some trouble with this redirect. I am trying to redirect to maint page globally on pool members being down. However, I need to redirect a certain url and a certain URI to a seperate page if ...
nathe
Cirrocumulus
Nov 07, 2012Saw one mistake in the code so slight adjustment. Also added a log at the beginning just to be sure of what we're seeing:
when HTTP_REQUEST {
log local0. "Host is [HTTP::host], URI is [HTTP::uri]"
if { ([active_members [LB::server pool]] == 0) && ([string tolower [HTTP::host]] starts_with "abc.webserver.com") } {
HTTP::redirect "http://sorrypage.net/default_api.aspx"
} elseif { ([active_members [LB::server pool]] == 0) && ([string tolower [HTTP::uri]] starts_with "/identity/issue/oauth2/token") } {
HTTP::redirect "http://sorrypage.net/default_api.aspx"
} elseif { ([active_members [LB::server pool]] == 0) } {
HTTP::redirect "http://maintenance.cloudapp.net"
}
}
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
