Forum Discussion
F5_Freek_243545
Nimbostratus
Sep 11, 2017Redirection not working
Hi Friends,
I was configuring redirect with three conditions and seems it is not working properly. Can anyone suggest if any changes on this code below?
when HTTP_REQUEST {
set referrer_host [URI::host [HTTP::header value Referer]]
if { ([string tolower [HTTP::host]] equals "yyy.com") and (([HTTP::uri] equals "/") and ( $referrer_host eq "www.abc.com") ) } {
HTTP::respond 301 "Location" "https://xxx.com/login"
return
}
if { ([string tolower [HTTP::host]] equals "yyy.com") and (([HTTP::uri] equals "/") and ( $referrer_host ne "www.xxx.com") ) } {
HTTP::respond 301 "Location" "https://xxx.com/login"
return
}
}Is there any way we can use switch statements here?
No RepliesBe the first to reply
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