Forum Discussion
Michael_193050
Nimbostratus
Jul 16, 2015redirect based on host and uri
Hi i have the below irule which is working fine. I'm trying to make it more efficient and only issue one redirect if the request came in as https://oldsite.com/. Currently what happens is i get the f...
Michael_193050
Nimbostratus
Jul 16, 2015I added this and it's working fine. Let me know if there is a more efficient way of doing this thru a switch statement.
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] eq "oldsite.com") and ([string tolower [HTTP::uri]] eq "/") } {
HTTP::redirect "https://newsite.com/identitymanagement/default.aspx"
}
elseif {[string tolower [HTTP::uri]] eq "/"} {
HTTP::redirect "https://newsite.com/identitymanagement/default.aspx"
}
elseif {[string tolower [HTTP::host]] eq "oldsite.com"} {
HTTP::redirect "https://newsite.com[HTTP::uri]"
}
}
Thanks
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