Forum Discussion
kirk_stanford_5
Nimbostratus
Nov 03, 2014Multiple URL redirect based on incoming URL definition...
I posted this last week however the answer provided did not work. I am looking for other suggestions. Thanks in advance to all that answer.
I have a need to redirect traffic coming from diffe...
Hannes_Rapp
Nimbostratus
Nov 05, 2014Try the solution below.
Additionally, my recommendation would be to uncomment the event disable statements, if there are other iRules attached to VS which are invoking redirects/responses. (Multiple invocations of redirect/response statements are not permitted and will result in a TCL error)
when HTTP_REQUEST {
set VISITOR "external"
if { [class match [IP::client_addr] equals "data_ip_internal_networks"] } {
set VISITOR "internal"
}
if {$VISITOR == "external"} {
switch [HTTP::host][HTTP::uri] {
"qa-myaccess.com/Login/GentivaLinkTest" {
HTTP::respond 301 location "
event disable
}
"qa-myaccess.gentiva.ghsnet.com/Login/Relias" {
HTTP::respond 301 location "
event disable
}
default {
HTTP::respond 301 location "">
event disable
}
}
} elseif {$VISITOR == "internal"} {
switch [HTTP::host][HTTP::uri] {
"qa-myaccess.com/Login/GentivaLinkTest" {
HTTP::respond 301 location "
event disable
}
"qa-myaccess.gentiva.ghsnet.com/Login/Relias" {
HTTP::respond 301 location "
event disable
}
default {
HTTP::respond 301 location "">
event disable
}
}
}
}
- Hannes_RappNov 05, 2014
Nimbostratus
Note, this retarded encoding tool appears interpret hyperlinks in its own format regardless of code block that was used. Can't find a way to correct it. For both SWITCH statements, the correct code for "default" section would be as follows: default { HTTP::respond 301 location "http://qa-myaccess.com/empowerID" event disable }
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